summaryrefslogtreecommitdiff
path: root/bootstraptest/test_flow.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/test_flow.rb')
-rw-r--r--bootstraptest/test_flow.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb
index 46ca1a0c6aa..84ef2164218 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