Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add spec for Range#=== to behave like Range#cover? in Ruby 2.7 #797

Merged
merged 2 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/range/case_compare_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions core/range/cover_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions core/range/shared/cover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down