diff options
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/module/refine_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/ruby/core/module/refine_spec.rb b/spec/ruby/core/module/refine_spec.rb index 287aa601a9..97645e5466 100644 --- a/spec/ruby/core/module/refine_spec.rb +++ b/spec/ruby/core/module/refine_spec.rb @@ -425,6 +425,24 @@ describe "Module#refine" do end end + ruby_version_is "2.6" do + it "is honored by Kernel#public_send" do + refinement = Module.new do + refine ModuleSpecs::ClassWithFoo do + def foo; "foo from refinement"; end + end + end + + result = nil + Module.new do + using refinement + result = ModuleSpecs::ClassWithFoo.new.public_send :foo + end + + result.should == "foo from refinement" + end + end + ruby_version_is "" ... "2.5" do it "is not honored by string interpolation" do refinement = Module.new do |