diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-06-24 11:23:06 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-06-27 16:27:22 -0500 |
commit | 40626943d2c0a668c8c3b0fefc7193841f749b46 (patch) | |
tree | 9f74dd614dd0dda2ca65612fa7b5ea55f324fd84 | |
parent | 0832d887bda196d966b3fc13c91e65136ab9f0e7 (diff) | |
download | bundler-40626943d2c0a668c8c3b0fefc7193841f749b46.tar.gz |
Update specs for improved resolver source errors
-rw-r--r-- | spec/commands/exec_spec.rb | 3 | ||||
-rw-r--r-- | spec/commands/lock_spec.rb | 3 | ||||
-rw-r--r-- | spec/install/gemfile/git_spec.rb | 6 | ||||
-rw-r--r-- | spec/install/post_bundle_message_spec.rb | 5 |
4 files changed, 10 insertions, 7 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 051644ed60..3e4d55c42f 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -451,7 +451,8 @@ describe "bundle exec" do let(:exit_code) { Bundler::GemNotFound.new.status_code } let(:expected) { "" } let(:expected_err) { <<-EOS.strip } -\e[31mCould not find gem 'rack (= 2)' in any of the gem sources listed in your gems.rb or available on this machine.\e[0m +\e[31mCould not find gem 'rack (= 2)' in locally installed gems. +The source contains 'rack' at: 0.9.1, 1.0.0\e[0m \e[33mRun `bundle install` to install missing gems.\e[0m EOS diff --git a/spec/commands/lock_spec.rb b/spec/commands/lock_spec.rb index 5b2b465192..ea6f3219bb 100644 --- a/spec/commands/lock_spec.rb +++ b/spec/commands/lock_spec.rb @@ -85,7 +85,8 @@ describe "bundle lock" do it "does not fetch remote specs when using the --local option" do bundle "lock --update --local", :expect_err => true - expect(err).to include("sources listed in your gems.rb or available on this machine") + expect(err).to include("or installed locally."). + and include("The source does not contain any versions of 'rails'.") end it "writes to a custom location using --lockfile" do diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index b7abba63bb..52f939ebc2 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -82,7 +82,7 @@ describe "bundle install with git sources" do gem "foo", "1.1", :git => "#{lib_path("foo-1.0")}" G - expect(err).to include("Source contains 'foo' at: 1.0 ruby") + expect(err).to include("The source contains 'foo' at: 1.0") end it "complains with version and platform if pinned specs don't exist in the git repo" do @@ -98,7 +98,7 @@ describe "bundle install with git sources" do end G - expect(err).to include("Source contains 'only_java' at: 1.0 java") + expect(err).to include("The source contains 'only_java' at: 1.0 java") end it "complains with multiple versions and platforms if pinned specs don't exist in the git repo" do @@ -119,7 +119,7 @@ describe "bundle install with git sources" do end G - expect(err).to include("Source contains 'only_java' at: 1.0 java, 1.1 java") + expect(err).to include("The source contains 'only_java' at: 1.0 java, 1.1 java") end it "still works after moving the application directory" do diff --git a/spec/install/post_bundle_message_spec.rb b/spec/install/post_bundle_message_spec.rb index 4e89d32432..6be21f35a8 100644 --- a/spec/install/post_bundle_message_spec.rb +++ b/spec/install/post_bundle_message_spec.rb @@ -95,12 +95,13 @@ describe "post bundle message" do describe "with misspelled or non-existent gem name" do it "should report a helpful error message" do - install_gemfile <<-G + install_gemfile <<-G, :expect_err => true source "file://#{gem_repo1}" gem "rack" gem "not-a-gem", :group => :development G - expect(err).to include("Could not find gem 'not-a-gem' in any of the gem sources listed in your gems.rb or available on this machine.") + expect(err).to include("Could not find gem 'not-a-gem' in rubygems repository"). + and include("or installed locally.\nThe source does not contain any versions of 'not-a-gem'.") end end end |