From 947c8bb2a0694f960ede2013ba8651d7adcefaaf Mon Sep 17 00:00:00 2001 From: lxxxvi Date: Mon, 19 Oct 2020 15:26:39 +0200 Subject: [PATCH] move shared Range#cover? specs for subranges to own group PR #797 introduces specs for `:===` to behave like `:cover?`, except for subranges. In order to reuse the `describe :range_cover, shared: true` group for `:===`, it's been suggested to move specs related to subranges to its own group. --- core/range/cover_spec.rb | 1 + core/range/shared/cover.rb | 2 ++ 2 files changed, 3 insertions(+) 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