1
0
Fork 0
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:
Nobuyoshi Nakada 2021-10-22 13:53:21 +09:00
parent 4446942f1a
commit 9f4f3bd1cc
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -298,6 +298,7 @@ describe "Module#refine" do
result.should == "foo from IncludeMeLater"
end
ruby_version_is ""..."3.1" do
it "looks in prepended modules from the refinement first" do
refined_class = ModuleSpecs.build_refined_class
@ -356,6 +357,7 @@ describe "Module#refine" do
result.should == "foo from included module"
end
end
it "looks in the class then" do
refined_class = ModuleSpecs.build_refined_class
@ -704,6 +706,7 @@ describe "Module#refine" do
result.should == "foo"
end
ruby_version_is ""..."3.1" do
it "looks in the refined class from included module" do
refined_class = ModuleSpecs.build_refined_class(for_super: true)
@ -754,6 +757,7 @@ describe "Module#refine" do
result.should == [:A, :C]
end
end
# super in a method of a refinement invokes the method in the refined
# class even if there is another refinement which has been activated
@ -816,6 +820,7 @@ describe "Module#refine" do
end
end
ruby_version_is ""..."3.1" do
it "does't have access to active refinements for C from included module" do
refined_class = ModuleSpecs.build_refined_class
@ -987,6 +992,7 @@ describe "Module#refine" do
result.should == [:A, :LOCAL, :C]
end
end
end
it 'and alias aliases a method within a refinement module, but not outside it' do
Module.new do