diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-01-14 13:38:17 +0900 |
---|---|---|
committer | NARUSE, Yui <nurse@users.noreply.github.com> | 2021-01-14 16:44:42 +0900 |
commit | 93dcf0828dc8e627e0c24497795d927911a9d993 (patch) | |
tree | 391f87ebf731d82c74fc44322a012024c3bd62f7 /spec/bundler/bundler/source | |
parent | c721e36ceca587d823a765cbbad90911a20cffce (diff) |
Merge Bundler-2.2.5
Diffstat (limited to 'spec/bundler/bundler/source')
-rw-r--r-- | spec/bundler/bundler/source/git/git_proxy_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/bundler/source/git_spec.rb | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/spec/bundler/bundler/source/git/git_proxy_spec.rb b/spec/bundler/bundler/source/git/git_proxy_spec.rb index 35702d7763..97f06973cb 100644 --- a/spec/bundler/bundler/source/git/git_proxy_spec.rb +++ b/spec/bundler/bundler/source/git/git_proxy_spec.rb @@ -130,18 +130,20 @@ 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_for_display) { "git #{command.shelljoin}" } it "fails gracefully when resetting to the revision fails" do 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).to receive(:git).with(*command, :dir => destination).and_raise(Bundler::Source::Git::GitCommandError.new(command_for_display, destination)) expect(subject).not_to receive(:git) expect { subject.copy_to(destination, submodules) }. to raise_error( Bundler::Source::Git::MissingGitRevisionError, - "Git error: command `git #{command}` in directory #{destination} has failed.\n" \ - "Revision #{revision} does not exist in the repository #{uri}. Maybe you misspelled it?" \ + "Git error: command `#{command_for_display}` in directory #{destination} has failed.\n" \ + "Revision #{revision} does not exist in the repository #{uri}. Maybe you misspelled it?\n" \ + "If this error persists you could try removing the cache directory '#{destination}'" ) end end diff --git a/spec/bundler/bundler/source/git_spec.rb b/spec/bundler/bundler/source/git_spec.rb index f7475a35aa..6668b6e69a 100644 --- a/spec/bundler/bundler/source/git_spec.rb +++ b/spec/bundler/bundler/source/git_spec.rb @@ -14,14 +14,14 @@ RSpec.describe Bundler::Source::Git do describe "#to_s" do it "returns a description" do - expect(subject.to_s).to eq "https://github.com/foo/bar.git (at master)" + expect(subject.to_s).to eq "https://github.com/foo/bar.git" end context "when the URI contains credentials" do let(:uri) { "https://my-secret-token:x-oauth-basic@github.com/foo/bar.git" } it "filters credentials" do - expect(subject.to_s).to eq "https://x-oauth-basic@github.com/foo/bar.git (at master)" + expect(subject.to_s).to eq "https://x-oauth-basic@github.com/foo/bar.git" end end end |