-
-
Notifications
You must be signed in to change notification settings - Fork 390
[Core/hash] Add specs for Hash #<=, #>=, #<, #> for Ruby 2.3 #160
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
Conversation
Thanks, this a good start! |
@h2 = {a:1, b:2, c:3} | ||
end | ||
|
||
it "expects h1 <= h1 to return true" do |
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.
In general, it's better if the spec descriptions explain the behavior, for instance here it could be:
returns true when comparing against itself
or ... against the same hash
.
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.
👍 sure, thanks.
@eregon Hello Benoit, I have updated specs, please take a look. Thank you. |
Great work! 😀 I only have one concern left: we should specify what happens when the keys match but the values don't. Could you add an example per method about that? 😔 |
I notice one thing that in rubyspec test suite, we use But in CRuby, those methods are defined as lt, le, gt, ge, do you think we should change rubyspec test suite file names and respective tests to be consistent? |
[Core/hash] Add specs for Hash #<=, #>=, #<, #> for Ruby 2.3
Awesome, thank you for writing these specs! 🎉 Internal names of MRI are not considered, as they could be anything. |
Thanks for the link! 🙇 |
specs are from https://github.com/ruby/ruby/blob/d68c3ecf/test/ruby/test_hash.rb#L1311-L1334.