-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, sorry for the late review.
6feb48b
to
20516e6
Compare
@eregon Thanks for your review! Interestingly some tests started to fail now (see bottom). Apparently # Ruby v2.7.2
(2..5).cover?((3..4)) # => true
(2..5) === (3..4) # => false I am not sure if this is expected, hence if I understand the Bug #15449 description correctly. Should What do you think? Failing tests
(0..10).send(@method, (3..7)).should be_true
(0..10).send(@method, (3.1..7.9)).should be_true
(0..10).send(@method, (0..10)).should be_true |
It's expected So let's move spec/core/range/shared/cover.rb Lines 94 to 152 in c8bc53a
describe :range_cover_subrange, shared: true do , that way we only test that for Range#cover? itself.
|
PR ruby#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.
@eregon Thank you for your explanation. I added a new commit according your suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, looks good!
Hello again 👋
From #745 :
To cover that (pun intended), I basically just added this to
Range#===
specsDo you think this is sufficient? 🙈