summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-14 17:59:42 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-14 17:59:42 +0000
commit639eff2ea7738cbaca771a8fb8e2e20dde1585e3 (patch)
tree57dd0b29d534329d5d6195eb7077813ba58eae2a /test
parentedf505a7e8d52970a2a1ae29ab450abf3819a63b (diff)
merge revision(s) 56520: [Backport #12876]
* vm_eval.c (vm_call0_body): follow the original class, not to loop the prepended module. [ruby-core:77784] [Bug #12876] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_super.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb
index 06e3e6e3b5..2764cf534b 100644
--- a/test/ruby/test_super.rb
+++ b/test/ruby/test_super.rb
@@ -530,4 +530,18 @@ class TestSuper < Test::Unit::TestCase
assert_equal "b", b.new.foo{"c"}
end
+
+ def test_public_zsuper_with_prepend
+ bug12876 = '[ruby-core:77784] [Bug #12876]'
+ m = EnvUtil.labeled_module("M")
+ c = EnvUtil.labeled_class("C") {prepend m; public :initialize}
+ o = assert_nothing_raised(Timeout::Error, bug12876) {
+ Timeout.timeout(3) {c.new}
+ }
+ assert_instance_of(c, o)
+ m.module_eval {def initialize; raise "exception in M"; end}
+ assert_raise_with_message(RuntimeError, "exception in M") {
+ c.new
+ }
+ end
end