1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_iterator.rb (test_block_argument_without_paren): added.

(follows sample/test.rb)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nahi 2003-10-06 06:18:45 +00:00
parent 3d307549a5
commit 6e6b863d53
2 changed files with 16 additions and 6 deletions

View file

@ -56,14 +56,19 @@ class TestIterator < Test::Unit::TestCase
tt{|i| break if i == 5}
assert_equal(5, i)
$x = false
begin
assert_raises(ArgumentError) do
tt3{}
rescue ArgumentError
$x = true
rescue Exception
end
assert($x)
end
def tt4 &block
tt2(raise(ArgumentError,""),&block)
end
def test_block_argument_without_paren
assert_raises(ArgumentError) do
tt4{}
end
end
# iterator break/redo/next/retry