diff options
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_flow.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb index 46ca1a0c6a..84ef216421 100644 --- a/bootstraptest/test_flow.rb +++ b/bootstraptest/test_flow.rb @@ -502,3 +502,24 @@ assert_equal %Q{ENSURE\n}, %q{ test }, '[ruby-dev:37967]' +[['[ruby-core:28129]', %q{ + class Bug2728 + include Enumerable + define_method(:dynamic_method) do + "dynamically defined method" + end + def each + begin + yield :foo + ensure + dynamic_method + end + end + end + e = Bug2728.new +}]].each do |bug, src| + assert_equal "foo", src + %q{e.detect {true}}, bug + assert_equal "true", src + %q{e.any? {true}}, bug + assert_equal "false", src + %q{e.all? {false}}, bug + assert_equal "true", src + %q{e.include?(:foo)}, bug +end |