From 4ce307aeee3e89b1bec5e275b253c198d12131d3 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 30 Nov 2013 04:21:22 +0000 Subject: range.c: revert the old behavior * range.c (range_each): revert the old behavior, no block is given to the yielded block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_range.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 914baf9ecf..12c0c59605 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -558,4 +558,12 @@ class TestRange < Test::Unit::TestCase assert_equal(42, answer, msg) } end + + def test_each_no_blockarg + a = "a" + def a.upto(x, e, &b) + super {|y| b.call(y) {|z| assert(false)}} + end + (a.."c").each {|x, &b| assert_nil(b)} + end end -- cgit v1.2.3