diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-06-28 11:06:03 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-03 09:29:56 +0900 |
commit | e6dc7b5b5b8e73f01b24d86a9c7b6026ae012b76 (patch) | |
tree | 46f38cee014776e5277a020fc30be1f43c55ba73 /spec | |
parent | 4b1395ab4ae7b6b9e22362ccb08d103bdec744f4 (diff) |
[bundler/bundler] Improve spec to be more realistic
https://github.com/bundler/bundler/commit/ca96316b97
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/bundler/source/git/git_proxy_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/bundler/bundler/source/git/git_proxy_spec.rb b/spec/bundler/bundler/source/git/git_proxy_spec.rb index 8ac0ae4dd0..c18490233d 100644 --- a/spec/bundler/bundler/source/git/git_proxy_spec.rb +++ b/spec/bundler/bundler/source/git/git_proxy_spec.rb @@ -128,17 +128,18 @@ 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}" } 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 ")) - expect(subject).to receive(:git).with("reset --hard #{revision}").and_raise(Bundler::Source::Git::GitCommandError, "command") + expect(subject).to receive(:git).with(command).and_raise(Bundler::Source::Git::GitCommandError, command) 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" \ + "Git error: command `git #{command}` in directory #{destination} has failed.\n" \ "Revision #{revision} does not exist in the repository #{uri}. Maybe you misspelled it?" \ ) end |