summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-06 06:18:45 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-06 06:18:45 +0000
commit6e6b863d53253c67b4b6d013a8f26b77f1ac354a (patch)
tree4c9f2f1f6cdae0bb7ca465d321e7f49c6a8794ca
parent3d307549a5ab70856adb1707e3fbe82471a20d6c (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_iterator.rb17
2 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index c6b436c53b..b6d13b674c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Oct 6 15:17:23 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * test/ruby/test_iterator.rb (test_block_argument_without_paren):
+ added. (follows sample/test.rb)
+
Mon Oct 6 11:57:06 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* 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