From 4053e8ba0d39b688440fedee2ab3fffabcd64312 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 10 Jan 2022 16:29:54 +0100 Subject: Update to ruby/spec@226cfdc --- spec/ruby/core/module/include_spec.rb | 21 +++++++++++++++++++++ spec/ruby/core/module/prepend_spec.rb | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'spec/ruby/core/module') diff --git a/spec/ruby/core/module/include_spec.rb b/spec/ruby/core/module/include_spec.rb index 128b9af2bf..c47e052d22 100644 --- a/spec/ruby/core/module/include_spec.rb +++ b/spec/ruby/core/module/include_spec.rb @@ -532,6 +532,27 @@ describe "Module#include" do B.foo.should == 'n' end end + + it "overrides a previous super method call" do + c1 = Class.new do + def foo + [:c1] + end + end + c2 = Class.new(c1) do + def foo + [:c2] + super + end + end + c2.new.foo.should == [:c2, :c1] + m = Module.new do + def foo + [:m1] + end + end + c2.include(m) + c2.new.foo.should == [:c2, :m1] + end end describe "Module#include?" do diff --git a/spec/ruby/core/module/prepend_spec.rb b/spec/ruby/core/module/prepend_spec.rb index 04cc27d472..d636e023ed 100644 --- a/spec/ruby/core/module/prepend_spec.rb +++ b/spec/ruby/core/module/prepend_spec.rb @@ -499,7 +499,7 @@ describe "Module#prepend" do c.dup.new.should be_kind_of(m) end - ruby_version_is '0'...'3.0' do + ruby_version_is ''...'3.0' do it "keeps the module in the chain when dupping an intermediate module" do m1 = Module.new { def calc(x) x end } m2 = Module.new { prepend(m1) } -- cgit v1.2.3