summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_super.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb
index aa09f9e1b9..418f293f66 100644
--- a/test/ruby/test_super.rb
+++ b/test/ruby/test_super.rb
@@ -633,6 +633,35 @@ class TestSuper < Test::Unit::TestCase
}
end
+ def test_super_with_included_prepended_module_method_caching_bug_20716
+ a = Module.new do
+ def test(*args)
+ super
+ end
+ end
+
+ b = Module.new do
+ def test(a)
+ a
+ end
+ end
+
+ c = Class.new
+
+ b.prepend(a)
+ c.include(b)
+
+ assert_equal(1, c.new.test(1))
+
+ b.class_eval do
+ def test
+ :test
+ end
+ end
+
+ assert_equal(:test, c.new.test)
+ end
+
class TestFor_super_with_modified_rest_parameter_base
def foo *args
args