diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_iterator.rb | 17 |
2 files changed, 16 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Mon Oct 6 15:17:23 2003 NAKAMURA, Hiroshi <[email protected]> + + * test/ruby/test_iterator.rb (test_block_argument_without_paren): + added. (follows sample/test.rb) + Mon Oct 6 11:57:06 2003 NAKAMURA, Hiroshi <[email protected]> * test/ruby/test_beginendblock.rb, test/ruby/beginmainend.rb: added 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 |