From 69f03c864eb193a163631d9a208fd64944b078dc Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 26 Dec 2021 23:17:14 +0900 Subject: Remove Refinement#include and Refinement#prepend --- spec/ruby/core/module/refine_spec.rb | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'spec/ruby/core') diff --git a/spec/ruby/core/module/refine_spec.rb b/spec/ruby/core/module/refine_spec.rb index f6751a42da..56ffc7ead2 100644 --- a/spec/ruby/core/module/refine_spec.rb +++ b/spec/ruby/core/module/refine_spec.rb @@ -243,28 +243,30 @@ describe "Module#refine" do result.should == "foo from singleton class" end - it "looks in the included modules for builtin methods" do - result = ruby_exe(<<-RUBY) - a = Module.new do - def /(other) quo(other) end - end + ruby_version_is ""..."3.2" do + it "looks in the included modules for builtin methods" do + result = ruby_exe(<<-RUBY) + a = Module.new do + def /(other) quo(other) end + end - refinement = Module.new do - refine Integer do - include a + refinement = Module.new do + refine Integer do + include a + end end - end - result = nil - Module.new do - using refinement - result = 1 / 2 - end + result = nil + Module.new do + using refinement + result = 1 / 2 + end - print result.class - RUBY + print result.class + RUBY - result.should == 'Rational' + result.should == 'Rational' + end end it "looks in later included modules of the refined module first" do -- cgit v1.2.3