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

Fixed "Comparable#== will no more rescue exceptions of #<=>" (bsc#933470) #145

Merged
merged 4 commits into from Jun 3, 2015

Conversation

mvidner
Copy link
Member

@mvidner mvidner commented Jun 3, 2015

https://bugzilla.suse.com/show_bug.cgi?id=933470

Term and Path would raise exceptions when <=> was used to compare them
with something that was not a Term or Path.

In particular it happened during RSpec argument matching.

In older Ruby core, Comparable#== would silently mask such exceptions,
now it started producing warnings.
https://bugs.ruby-lang.org/issues/7688

which triggers when tests are run as
LANG=en_US rspec tests/ruby/*_spec.rb
@@ -75,6 +71,10 @@ def term(*params)
it "if value is equal, then use params to comparison" do
expect(term(:HBox, "test")).to be > term(:HBox)
end

it "if non-term, then uncomparable" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe be specific like like then return nil?

@jreidinger
Copy link
Member

Thanks for fixing, just two nitpickings.

…470)

Term and Path would raise exceptions when <=> was used to compare them
with something that was not a Term or Path.

In particular it happened during RSpec argument matching.

In older Ruby core, Comparable#== would silently mask such exceptions,
now it started producing warnings.
https://bugs.ruby-lang.org/issues/7688
mvidner added a commit that referenced this pull request Jun 3, 2015
Fixed "Comparable#== will no more rescue exceptions of #<=>" (bsc#933470)
@mvidner mvidner merged commit 93e6d72 into master Jun 3, 2015
@mvidner mvidner deleted the comparable-spaceship branch June 8, 2015 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants