aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/module/refine_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/module/refine_spec.rb')
-rw-r--r--spec/ruby/core/module/refine_spec.rb79
1 files changed, 20 insertions, 59 deletions
diff --git a/spec/ruby/core/module/refine_spec.rb b/spec/ruby/core/module/refine_spec.rb
index cb50fcbce6..54217a9326 100644
--- a/spec/ruby/core/module/refine_spec.rb
+++ b/spec/ruby/core/module/refine_spec.rb
@@ -980,77 +980,38 @@ describe "Module#refine" do
result.should == [:B, :A, :LAST, :C]
end
- ruby_version_is ""..."3.0" do
- it "looks in the lexical scope refinements before other active refinements" do
- refined_class = ModuleSpecs.build_refined_class(for_super: true)
-
- refinement_local = Module.new do
- refine refined_class do
- def foo
- [:LOCAL] + super
- end
- end
- end
-
- a = Module.new do
- using refinement_local
+ it "looks in the lexical scope refinements before other active refinements" do
+ refined_class = ModuleSpecs.build_refined_class(for_super: true)
+ refinement_local = Module.new do
+ refine refined_class do
def foo
- [:A] + super
+ [:LOCAL] + super
end
end
-
- refinement = Module.new do
- refine refined_class do
- include a
- end
- end
-
- result = nil
- Module.new do
- using refinement
- result = refined_class.new.foo
- end
-
- result.should == [:A, :LOCAL, :C]
end
- end
-
- ruby_version_is "3.0" do
- # https://bugs.ruby-lang.org/issues/17007
- it "does not look in the lexical scope refinements before other active refinements" do
- refined_class = ModuleSpecs.build_refined_class(for_super: true)
- refinement_local = Module.new do
- refine refined_class do
- def foo
- [:LOCAL] + super
- end
- end
- end
-
- a = Module.new do
- using refinement_local
-
- def foo
- [:A] + super
- end
- end
+ a = Module.new do
+ using refinement_local
- refinement = Module.new do
- refine refined_class do
- include a
- end
+ def foo
+ [:A] + super
end
+ end
- result = nil
- Module.new do
- using refinement
- result = refined_class.new.foo
+ refinement = Module.new do
+ refine refined_class do
+ include a
end
+ end
- result.should == [:A, :C]
+ result = nil
+ Module.new do
+ using refinement
+ result = refined_class.new.foo
end
+
+ result.should == [:A, :LOCAL, :C]
end
end