1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_iterator.rb (test_block_passing): yield in method

argument behaves differently.  [ruby-dev:26274]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-08-10 22:57:38 +00:00
parent 160055b474
commit 90ac1484f1

View file

@ -189,6 +189,14 @@ class TestIterator < Test::Unit::TestCase
assert(!m2())
end
def m3(var, &block)
m(yield(var), &block)
end
def test_block_passing
assert_equal(100, m3(10) {|x|x*x})
end
class C
include Enumerable
def initialize