aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/endpoint_specification_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/endpoint_specification_spec.rb')
-rw-r--r--spec/bundler/endpoint_specification_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/bundler/endpoint_specification_spec.rb b/spec/bundler/endpoint_specification_spec.rb
index fccf1842..cdf81cd0 100644
--- a/spec/bundler/endpoint_specification_spec.rb
+++ b/spec/bundler/endpoint_specification_spec.rb
@@ -16,25 +16,26 @@ describe Bundler::EndpointSpecification do
let(:requirement2) { ">= 1.1.7" }
it "should return a Gem::Dependency" do
- expect(subject.send(:build_dependency, name, requirement1, requirement2)).to be_instance_of(Gem::Dependency)
+ expect(subject.send(:build_dependency, name, [requirement1, requirement2])).
+ to eq(Gem::Dependency.new(name, requirement1, requirement2))
end
context "when an ArgumentError occurs" do
before do
- allow(Gem::Dependency).to receive(:new).with(name, requirement1, requirement2) {
+ allow(Gem::Dependency).to receive(:new).with(name, [requirement1, requirement2]) {
raise ArgumentError.new("Some error occurred")
}
end
it "should raise the original error" do
- expect { subject.send(:build_dependency, name, requirement1, requirement2) }.to raise_error(
+ expect { subject.send(:build_dependency, name, [requirement1, requirement2]) }.to raise_error(
ArgumentError, "Some error occurred")
end
end
context "when there is an ill formed requirement" do
before do
- allow(Gem::Dependency).to receive(:new).with(name, requirement1, requirement2) {
+ allow(Gem::Dependency).to receive(:new).with(name, [requirement1, requirement2]) {
raise ArgumentError.new("Ill-formed requirement [\"#<YAML::Syck::DefaultKey")
}
# Eliminate extra line break in rspec output due to `puts` in `#build_dependency`
@@ -42,7 +43,7 @@ describe Bundler::EndpointSpecification do
end
it "should raise a Bundler::GemspecError with invalid gemspec message" do
- expect { subject.send(:build_dependency, name, requirement1, requirement2) }.to raise_error(
+ expect { subject.send(:build_dependency, name, [requirement1, requirement2]) }.to raise_error(
Bundler::GemspecError, /Unfortunately, the gem foo \(1\.0\.0\) has an invalid gemspec/)
end
end