mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Refinement#include and Refinement#prepend have been deprecated
This commit is contained in:
parent
598382f686
commit
22a7f7ec5a
1 changed files with 16 additions and 14 deletions
|
@ -664,26 +664,28 @@ describe "Module#refine" do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when super is called in a refinement" do
|
context "when super is called in a refinement" do
|
||||||
it "looks in the included to refinery module" do
|
ruby_version_is ""..."3.1" do
|
||||||
refined_class = ModuleSpecs.build_refined_class
|
it "looks in the included to refinery module" do
|
||||||
|
refined_class = ModuleSpecs.build_refined_class
|
||||||
|
|
||||||
refinement = Module.new do
|
refinement = Module.new do
|
||||||
refine refined_class do
|
refine refined_class do
|
||||||
include ModuleSpecs::IncludedModule
|
include ModuleSpecs::IncludedModule
|
||||||
|
|
||||||
def foo
|
def foo
|
||||||
super
|
super
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
result = nil
|
result = nil
|
||||||
Module.new do
|
Module.new do
|
||||||
using refinement
|
using refinement
|
||||||
result = refined_class.new.foo
|
result = refined_class.new.foo
|
||||||
end
|
end
|
||||||
|
|
||||||
result.should == "foo from included module"
|
result.should == "foo from included module"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "looks in the refined class" do
|
it "looks in the refined class" do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue