Class: TestStringArguments

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/ruby/string/arguments.rb,
lib/ruby/string/post_arguments.rb

Instance Method Summary collapse

Instance Method Details

#test_allObject



61
62
63
64
65
66
67
68
69
70
# File 'lib/ruby/string/arguments.rb', line 61

def test_all
	assert_equal(%w(), ''.arguments)
	assert_equal(%w(hello world those are arguments), 'hello world those are arguments'.arguments)
	assert_equal(%w(hello ruby\ world those are arguments), 'hello "ruby world" those are arguments'.arguments)
	assert_equal(%w(hello ruby\ world), 'hello "ruby world"'.arguments)
	assert_equal(%w(ruby\ world those are arguments), '"ruby world" those are arguments'.arguments)
	assert_equal(%w(hello ruby\ world those are arguments), 'hello ruby\ world those are arguments'.arguments)
	assert_raise(String::SingleQuoteException) { 'hello " ruby'.arguments }
	assert_raise(String::SingleQuoteException) { "hello ' ruby".arguments }
end