diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-12-26 23:17:14 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-12-26 23:28:54 +0900 |
commit | 69f03c864eb193a163631d9a208fd64944b078dc (patch) | |
tree | 36717898123ab9e361951a1bacdadc0015eab7b0 /spec/ruby | |
parent | 39bc5de83394a380c9967df74e06c824186f8560 (diff) | |
download | ruby-69f03c864eb193a163631d9a208fd64944b078dc.tar.gz |
Remove Refinement#include and Refinement#prepend
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/module/refine_spec.rb | 36 |
1 files changed, 19 insertions, 17 deletions
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 |