diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-06 06:18:45 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-06 06:18:45 +0000 |
commit | 6e6b863d53253c67b4b6d013a8f26b77f1ac354a (patch) | |
tree | 4c9f2f1f6cdae0bb7ca465d321e7f49c6a8794ca /test | |
parent | 3d307549a5ab70856adb1707e3fbe82471a20d6c (diff) | |
download | ruby-6e6b863d53253c67b4b6d013a8f26b77f1ac354a.tar.gz |
* 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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_iterator.rb | 17 |
1 files changed, 11 insertions, 6 deletions
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 |