summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-29 00:39:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-29 00:39:16 +0000
commit693eabb2be4a57f1300e6b73d6d8069b355782c6 (patch)
treedc33ae83b72e6b928ae49807636dc45418d5bbb3 /test/ruby
parent420b4ae26d69fff5d7e1ebef122b69502519dec9 (diff)
vm_eval.c: follow the original class
* 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/trunk@56520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-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 469ba60ff2..9691116fb4 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