From faa93e847da75c0b8f5bae70f8362f22865388a6 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 15 Jun 2008 16:50:37 +0000 Subject: * eval.c (rb_f_block_given_p): fix to skip class frame. [ruby-core:14813] * KNOWNBUGS.rb, bootstraptest/test_method.rb: move solved test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_method.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'bootstraptest/test_method.rb') diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb index 8b5d584e31..28cd2fbaf6 100644 --- a/bootstraptest/test_method.rb +++ b/bootstraptest/test_method.rb @@ -1026,3 +1026,34 @@ assert_not_match /method_missing/, %q{ STDERR.reopen(STDOUT) variable_or_mehtod_not_exist } + +assert_equal '[false, false, false, false, true, true]', %q{ + class C + define_method(:foo) { + block_given? + } + end + + C.new.foo {} + + class D + def foo + D.module_eval{ + define_method(:m1){ + block_given? + } + } + end + def bar + D.module_eval{ + define_method(:m2){ + block_given? + } + } + end + end + + D.new.foo + D.new.bar{} + [C.new.foo, C.new.foo{}, D.new.m1, D.new.m1{}, D.new.m2, D.new.m2{}] +}, '[ruby-core:14813]' -- cgit v1.2.3