[前][次][番号順一覧][スレッド一覧]

ruby-changes:69331

From: Nobuyoshi <ko1@a...>
Date: Fri, 22 Oct 2021 15:07:11 +0900 (JST)
Subject: [ruby-changes:69331] 22a7f7ec5a (master): Refinement#include and Refinement#prepend have been deprecated

https://git.ruby-lang.org/ruby.git/commit/?id=22a7f7ec5a

From 22a7f7ec5a23bf37c31b227ca0ebb198bfcda2af Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 22 Oct 2021 13:53:21 +0900
Subject: Refinement#include and Refinement#prepend have been deprecated

---
 spec/ruby/core/module/refine_spec.rb | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/spec/ruby/core/module/refine_spec.rb b/spec/ruby/core/module/refine_spec.rb
index aa9f955e05..f6751a42da 100644
--- a/spec/ruby/core/module/refine_spec.rb
+++ b/spec/ruby/core/module/refine_spec.rb
@@ -664,26 +664,28 @@ describe "Module#refine" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/module/refine_spec.rb#L664
   end
 
   context "when super is called in a refinement" do
-    it "looks in the included to refinery module" do
-      refined_class = ModuleSpecs.build_refined_class
+    ruby_version_is ""..."3.1" do
+      it "looks in the included to refinery module" do
+        refined_class = ModuleSpecs.build_refined_class
 
-      refinement = Module.new do
-        refine refined_class do
-          include ModuleSpecs::IncludedModule
+        refinement = Module.new do
+          refine refined_class do
+            include ModuleSpecs::IncludedModule
 
-          def foo
-            super
+            def foo
+              super
+            end
           end
         end
-      end
 
-      result = nil
-      Module.new do
-        using refinement
-        result = refined_class.new.foo
-      end
+        result = nil
+        Module.new do
+          using refinement
+          result = refined_class.new.foo
+        end
 
-      result.should == "foo from included module"
+        result.should == "foo from included module"
+      end
     end
 
     it "looks in the refined class" do
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]