diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-20 12:25:23 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-20 12:25:23 +0100 |
commit | 4bf058b56c8d9ab37f22dbd4a0c70b11a1950d2d (patch) | |
tree | 4ce72a0feca99a878fdf88999dc0498c3b68196c /spec/install/gemfile | |
parent | 18ca920b429be478ebf5c02827d938eca82e5463 (diff) | |
download | bundler-4bf058b56c8d9ab37f22dbd4a0c70b11a1950d2d.tar.gz |
Fix git source error message recommendations
So the we suggest an actually working command.
Diffstat (limited to 'spec/install/gemfile')
-rw-r--r-- | spec/install/gemfile/git_spec.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index 90ba8a7cfb..ac2849c8d8 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -497,7 +497,7 @@ RSpec.describe "bundle install with git sources" do expect(lockfile1).not_to eq(lockfile0) end - it "explodes if given path does not exist on install" do + it "explodes and gives correct solution if given path does not exist on install" do build_git "rack", "0.8" install_gemfile <<-G @@ -508,9 +508,17 @@ RSpec.describe "bundle install with git sources" do bundle %(config local.rack #{lib_path("local-rack")}) bundle :install expect(err).to match(/Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path('local-rack').to_s)} does not exist/) + + solution = "config unset local.rack" + expect(err).to match(/Check `bundle #{solution}` to remove the local override/) + + bundle solution + bundle :install + + expect(last_command.stderr).to be_empty end - it "explodes if branch is not given on install" do + it "explodes and gives correct solution if branch is not given on install" do build_git "rack", "0.8" FileUtils.cp_r("#{lib_path("rack-0.8")}/.", lib_path("local-rack")) @@ -522,6 +530,14 @@ RSpec.describe "bundle install with git sources" do bundle %(config local.rack #{lib_path("local-rack")}) bundle :install expect(err).to match(/Cannot use local override for rack-0.8 at #{Regexp.escape(lib_path('local-rack').to_s)} because :branch is not specified in Gemfile/) + + solution = "config unset local.rack" + expect(err).to match(/Specify a branch or use `bundle #{solution}` to remove the local override/) + + bundle solution + bundle :install + + expect(last_command.stderr).to be_empty end it "does not explode if disable_local_branch_check is given" do |