summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-10 14:18:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-10 14:18:52 +0000
commit9996945af9eb575a5e7658f076cf90fd17fc3c90 (patch)
tree8b8a9748353115477a1ba6e6e34602f460ea6369 /test
parent1a7aba1b47311f99a62dba5dfbf5518d6bb3c0cd (diff)
vm_eval.c: fix refined method when prepended
* vm_eval.c (vm_call0_body): refined module should not be skipped as prepended. [ruby-core:78073] [Bug #12920] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 5cbb11121b..6c32be5e61 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1775,6 +1775,20 @@ class TestRefinement < Test::Unit::TestCase
eval_using(AliasInSubclass::M, "AliasInSubclass::D.new.bar"))
end
+ def test_refine_with_prepend
+ assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}")
+ begin;
+ bug = '[ruby-core:78073] [Bug #12920]'
+ Integer.prepend(Module.new)
+ Module.new do
+ refine Integer do
+ define_method(:+) {}
+ end
+ end
+ assert_kind_of(Time, Time.now, bug)
+ end;
+ end
+
private
def eval_using(mod, s)