summaryrefslogtreecommitdiff
path: root/spec/bundler/bundler/source
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-01-14 13:36:38 +0900
committerNARUSE, Yui <nurse@users.noreply.github.com>2021-01-14 16:44:42 +0900
commitd4f5827a6d445941450a2ec5dac5e51e333ef745 (patch)
treed9b6d0308b49d8bc34cd47590e6953319c695e97 /spec/bundler/bundler/source
parent1824df40544b6f19f49baa7ce03c118d32bc3ca3 (diff)
Merge Bundler-2.2.4
Diffstat (limited to 'spec/bundler/bundler/source')
-rw-r--r--spec/bundler/bundler/source/git/git_proxy_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/bundler/bundler/source/git/git_proxy_spec.rb b/spec/bundler/bundler/source/git/git_proxy_spec.rb
index 4744e0cd4c..35702d7763 100644
--- a/spec/bundler/bundler/source/git/git_proxy_spec.rb
+++ b/spec/bundler/bundler/source/git/git_proxy_spec.rb
@@ -11,21 +11,21 @@ RSpec.describe Bundler::Source::Git::GitProxy do
context "with configured credentials" do
it "adds username and password to URI" do
Bundler.settings.temporary(uri => "u:p") do
- expect(subject).to receive(:git_retry).with(match("https://u:p@github.com/rubygems/rubygems.git"))
+ expect(subject).to receive(:git_retry).with("clone", "https://u:p@github.com/rubygems/rubygems.git", any_args)
subject.checkout
end
end
it "adds username and password to URI for host" do
Bundler.settings.temporary("github.com" => "u:p") do
- expect(subject).to receive(:git_retry).with(match("https://u:p@github.com/rubygems/rubygems.git"))
+ expect(subject).to receive(:git_retry).with("clone", "https://u:p@github.com/rubygems/rubygems.git", any_args)
subject.checkout
end
end
it "does not add username and password to mismatched URI" do
Bundler.settings.temporary("https://u:p@github.com/rubygems/rubygems-mismatch.git" => "u:p") do
- expect(subject).to receive(:git_retry).with(match(uri))
+ expect(subject).to receive(:git_retry).with("clone", uri, any_args)
subject.checkout
end
end
@@ -34,7 +34,7 @@ RSpec.describe Bundler::Source::Git::GitProxy do
Bundler.settings.temporary("github.com" => "u:p") do
original = "https://orig:info@github.com/rubygems/rubygems.git"
subject = described_class.new(Pathname("path"), original, "HEAD")
- expect(subject).to receive(:git_retry).with(match(original))
+ expect(subject).to receive(:git_retry).with("clone", original, any_args)
subject.checkout
end
end
@@ -129,12 +129,12 @@ RSpec.describe Bundler::Source::Git::GitProxy do
context "when given a SHA as a revision" do
let(:revision) { "abcd" * 10 }
- let(:command) { "reset --hard #{revision}" }
+ let(:command) { ["reset", "--hard", revision] }
it "fails gracefully when resetting to the revision fails" do
- expect(subject).to receive(:git_retry).with(start_with("clone ")) { destination.mkpath }
- expect(subject).to receive(:git_retry).with(start_with("fetch "), :dir => destination)
- expect(subject).to receive(:git).with(command, :dir => destination).and_raise(Bundler::Source::Git::GitCommandError.new(command, cache, destination))
+ expect(subject).to receive(:git_retry).with("clone", any_args) { destination.mkpath }
+ expect(subject).to receive(:git_retry).with("fetch", any_args, :dir => destination)
+ expect(subject).to receive(:git).with(*command, :dir => destination).and_raise(Bundler::Source::Git::GitCommandError.new(command, cache, destination))
expect(subject).not_to receive(:git)
expect { subject.copy_to(destination, submodules) }.