forked from rubygems/bundler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DepProxy#== undefind method error
DepProxy#== crashed with an undefind method error for anything other than a DepProxy class or nil as parameter. This was caused that it was assumed only DepProxy instances or nil can get passed as parameter. This commit implements checking the class as well and returns false if the classes are not the same. Fixes jruby/jruby#5280 travis-ci/travis-ci#9994
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe Bundler::DepProxy do | ||
let(:dep) { Bundler::Dependency.new("rake", ">= 0") } | ||
subject { described_class.new(dep, Gem::Platform::RUBY) } | ||
let(:same) { subject } | ||
let(:other) { subject.dup } | ||
let(:different) { described_class.new(dep, Gem::Platform::JAVA) } | ||
|
||
describe "#eql?" do | ||
it { expect(subject.eql?(same)).to be true } | ||
it { expect(subject.eql?(other)).to be true } | ||
it { expect(subject.eql?(different)).to be false } | ||
it { expect(subject.eql?(nil)).to be false } | ||
it { expect(subject.eql?("foobar")).to be false } | ||
end | ||
end |