From 6e6b863d53253c67b4b6d013a8f26b77f1ac354a Mon Sep 17 00:00:00 2001 From: nahi Date: Mon, 6 Oct 2003 06:18:45 +0000 Subject: * 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 --- test/ruby/test_iterator.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb index d05309adfc..9a5b9c5352 100644 --- a/test/ruby/test_iterator.rb +++ b/test/ruby/test_iterator.rb @@ -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 -- cgit v1.2.3