diff --git a/core/range/case_compare_spec.rb b/core/range/case_compare_spec.rb index 0ca03f6a35..b1afa90a41 100644 --- a/core/range/case_compare_spec.rb +++ b/core/range/case_compare_spec.rb @@ -25,4 +25,9 @@ (range === RangeSpecs::WithoutSucc.new(2)).should == true end end + + ruby_version_is "2.7" do + it_behaves_like :range_cover_and_include, :=== + it_behaves_like :range_cover, :=== + end end diff --git a/core/range/cover_spec.rb b/core/range/cover_spec.rb index 29c0e0bfa8..fa881607e9 100644 --- a/core/range/cover_spec.rb +++ b/core/range/cover_spec.rb @@ -6,4 +6,5 @@ describe "Range#cover?" do it_behaves_like :range_cover_and_include, :cover? it_behaves_like :range_cover, :cover? + it_behaves_like :range_cover_subrange, :cover? end diff --git a/core/range/shared/cover.rb b/core/range/shared/cover.rb index 33d416fef5..5b09cea4e0 100644 --- a/core/range/shared/cover.rb +++ b/core/range/shared/cover.rb @@ -90,7 +90,9 @@ end end end +end +describe :range_cover_subrange, shared: true do ruby_version_is "2.6" do context "range argument" do it "accepts range argument" do