summaryrefslogtreecommitdiff
path: root/spec/install
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-06-21 16:10:20 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-06-23 12:43:55 -0500
commit9e7a22b3dda65ecc53090839dee8da362c2d79f1 (patch)
treee35b9cd4830ac4d32f531a97aa8ebc825c2ba922 /spec/install
parent864fe937a1e587455592cddc098fd0131ba914cd (diff)
downloadbundler-9e7a22b3dda65ecc53090839dee8da362c2d79f1.tar.gz
Get the 2.0 specs passing under 2.0
Diffstat (limited to 'spec/install')
-rw-r--r--spec/install/bundler_spec.rb12
-rw-r--r--spec/install/failure_spec.rb2
-rw-r--r--spec/install/gemfile/gemspec_spec.rb10
-rw-r--r--spec/install/gemfile/git_spec.rb32
-rw-r--r--spec/install/gemfile/groups_spec.rb4
-rw-r--r--spec/install/gems/compact_index_spec.rb2
-rw-r--r--spec/install/gems/dependency_api_spec.rb2
-rw-r--r--spec/install/gems/flex_spec.rb4
-rw-r--r--spec/install/gems/resolving_spec.rb5
-rw-r--r--spec/install/git_spec.rb4
10 files changed, 32 insertions, 45 deletions
diff --git a/spec/install/bundler_spec.rb b/spec/install/bundler_spec.rb
index ca17d19abd..69f85f4964 100644
--- a/spec/install/bundler_spec.rb
+++ b/spec/install/bundler_spec.rb
@@ -37,8 +37,6 @@ RSpec.describe "bundle install" do
G
nice_error = <<-E.strip.gsub(/^ {8}/, "")
- Fetching source index from file:#{gem_repo2}/
- Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (= 0.9.2)
@@ -50,7 +48,7 @@ RSpec.describe "bundle install" do
Could not find gem 'bundler (= 0.9.2)' in any of the sources
E
- expect(out).to eq(nice_error)
+ expect(last_command.bundler_err).to include(nice_error)
end
it "works for gems with multiple versions in its dependencies" do
@@ -98,8 +96,6 @@ RSpec.describe "bundle install" do
G
nice_error = <<-E.strip.gsub(/^ {8}/, "")
- Fetching source index from file:#{gem_repo2}/
- Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
activemerchant was resolved to 1.0, which depends on
@@ -108,7 +104,7 @@ RSpec.describe "bundle install" do
rails_fail was resolved to 1.0, which depends on
activesupport (= 1.2.3)
E
- expect(out).to include(nice_error)
+ expect(last_command.bundler_err).to include(nice_error)
end
it "causes a conflict if a child dependency conflicts with the Gemfile" do
@@ -119,8 +115,6 @@ RSpec.describe "bundle install" do
G
nice_error = <<-E.strip.gsub(/^ {8}/, "")
- Fetching source index from file:#{gem_repo2}/
- Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
activesupport (= 2.3.5)
@@ -128,7 +122,7 @@ RSpec.describe "bundle install" do
rails_fail was resolved to 1.0, which depends on
activesupport (= 1.2.3)
E
- expect(out).to include(nice_error)
+ expect(last_command.bundler_err).to include(nice_error)
end
it "can install dependencies with newer bundler version" do
diff --git a/spec/install/failure_spec.rb b/spec/install/failure_spec.rb
index c4568673f8..896138c659 100644
--- a/spec/install/failure_spec.rb
+++ b/spec/install/failure_spec.rb
@@ -18,7 +18,7 @@ RSpec.describe "bundle install" do
source "file:#{gem_repo2}"
gem "rails"
G
- expect(out).to end_with(<<-M.strip)
+ expect(last_command.bundler_err).to end_with(<<-M.strip)
An error occurred while installing activesupport (2.3.2), and Bundler cannot continue.
Make sure that `gem install activesupport -v '2.3.2'` succeeds before bundling.
diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb
index 5089914959..4f1a69688c 100644
--- a/spec/install/gemfile/gemspec_spec.rb
+++ b/spec/install/gemfile/gemspec_spec.rb
@@ -57,11 +57,11 @@ RSpec.describe "bundle install from an existing gemspec" do
it "should raise if there are no gemspecs available" do
build_lib("foo", :path => tmp.join("foo"), :gemspec => false)
- error = install_gemfile(<<-G)
+ install_gemfile(<<-G)
source "file://#{gem_repo2}"
gemspec :path => '#{tmp.join("foo")}'
G
- expect(error).to match(/There are no gemspecs at #{tmp.join('foo')}/)
+ expect(last_command.bundler_err).to match(/There are no gemspecs at #{tmp.join('foo')}/)
end
it "should raise if there are too many gemspecs available" do
@@ -69,11 +69,11 @@ RSpec.describe "bundle install from an existing gemspec" do
s.write("foo2.gemspec", build_spec("foo", "4.0").first.to_ruby)
end
- error = install_gemfile(<<-G)
+ install_gemfile(<<-G)
source "file://#{gem_repo2}"
gemspec :path => '#{tmp.join("foo")}'
G
- expect(error).to match(/There are multiple gemspecs at #{tmp.join('foo')}/)
+ expect(last_command.bundler_err).to match(/There are multiple gemspecs at #{tmp.join('foo')}/)
end
it "should pick a specific gemspec" do
@@ -188,7 +188,7 @@ RSpec.describe "bundle install from an existing gemspec" do
install_gemfile <<-G
gemspec :path => '#{tmp.join("foo")}'
G
- expect(@err).not_to match(/ahh/)
+ expect(last_command.stdboth).not_to include("ahh")
end
it "allows the gemspec to activate other gems" do
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb
index 59bbc9c016..ab66337ffa 100644
--- a/spec/install/gemfile/git_spec.rb
+++ b/spec/install/gemfile/git_spec.rb
@@ -275,7 +275,7 @@ RSpec.describe "bundle install with git sources" do
it "does not download random non-head refs" do
Dir.chdir(lib_path("foo-1.0")) do
- `git update-ref -m 'Bundler Spec!' refs/bundler/1 master~1`
+ sys_exec!("git update-ref -m 'Bundler Spec!' refs/bundler/1 master~1")
end
install_gemfile! <<-G
@@ -285,10 +285,10 @@ RSpec.describe "bundle install with git sources" do
G
# ensure we also git fetch after cloning
- bundle! :update
+ bundle! :update, :all => bundle_update_requires_all?
Dir.chdir(Dir[system_gem_path("cache/bundler/git/foo-*")].first) do
- @out = sys_exec("git ls-remote .")
+ sys_exec("git ls-remote .")
end
expect(out).not_to include("refs/bundler/1")
@@ -790,14 +790,14 @@ RSpec.describe "bundle install with git sources" do
s.write "lib/forced.rb", "FORCED = '1.1'"
end
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "forced 1.1"
Dir.chdir(lib_path("forced-1.0")) do
`git reset --hard HEAD^`
end
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "forced 1.0"
end
@@ -1176,7 +1176,7 @@ RSpec.describe "bundle install with git sources" do
gem "foo", :git => "#{lib_path("foo-1.0")}"
G
- expect(out).to end_with(<<-M.strip)
+ expect(last_command.bundler_err).to end_with(<<-M.strip)
An error occurred while installing foo (1.0), and Bundler cannot continue.
In Gemfile:
@@ -1260,9 +1260,10 @@ In Gemfile:
G
with_path_as("") do
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
end
- expect(out).to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git")
+ expect(last_command.bundler_err).
+ to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git")
end
it "installs a packaged git gem successfully" do
@@ -1276,15 +1277,14 @@ In Gemfile:
bundle "package --all"
simulate_new_machine
- bundle "install", :env => { "PATH" => "" }
+ bundle! "install", :env => { "PATH" => "" }
expect(out).to_not include("You need to install git to be able to use gems from git repositories.")
- expect(exitstatus).to be_zero if exitstatus
end
end
describe "when the git source is overridden with a local git repo" do
before do
- bundle "config --global local.foo #{lib_path("foo")}"
+ bundle! "config --global local.foo #{lib_path("foo")}"
end
describe "and git output is colorized" do
@@ -1319,9 +1319,8 @@ In Gemfile:
G
bundle :install
- expect(out).to_not include("password1")
- expect(err).to_not include("password1")
- expect(out).to include("Fetching https://user1@github.com/company/private-repo")
+ expect(last_command.stdboth).to_not include("password1")
+ expect(last_command.stdout).to include("Fetching https://user1@github.com/company/private-repo")
end
end
@@ -1336,9 +1335,8 @@ In Gemfile:
G
bundle :install
- expect(out).to_not include("oauth_token")
- expect(err).to_not include("oauth_token")
- expect(out).to include("Fetching https://x-oauth-basic@github.com/company/private-repo")
+ expect(last_command.stdboth).to_not include("oauth_token")
+ expect(last_command.stdout).to include("Fetching https://x-oauth-basic@github.com/company/private-repo")
end
end
end
diff --git a/spec/install/gemfile/groups_spec.rb b/spec/install/gemfile/groups_spec.rb
index ed264d8439..b49b64d1f0 100644
--- a/spec/install/gemfile/groups_spec.rb
+++ b/spec/install/gemfile/groups_spec.rb
@@ -363,8 +363,8 @@ RSpec.describe "bundle install with groups" do
it "does not hit the remote a second time" do
FileUtils.rm_rf gem_repo2
- bundle! "install --without rack"
- expect(out).not_to include "Fetching"
+ bundle! "install --without rack", :verbose => true
+ expect(last_command.stdboth).not_to match(/fetching/i)
end
end
end
diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb
index c42816a3fb..9fc5b1f90a 100644
--- a/spec/install/gems/compact_index_spec.rb
+++ b/spec/install/gems/compact_index_spec.rb
@@ -248,7 +248,7 @@ The checksum of /versions does not match the checksum provided by the server! So
gem "rack"
G
- bundle "update --full-index", :artifice => "compact_index"
+ bundle! "update --full-index", :artifice => "compact_index", :all => bundle_update_requires_all?
expect(out).to include("Fetching source index from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
end
diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb
index ffe572d208..60202d1658 100644
--- a/spec/install/gems/dependency_api_spec.rb
+++ b/spec/install/gems/dependency_api_spec.rb
@@ -238,7 +238,7 @@ RSpec.describe "gemcutter's dependency API" do
gem "rack"
G
- bundle "update --full-index", :artifice => "endpoint"
+ bundle! "update --full-index", :artifice => "endpoint", :all => bundle_update_requires_all?
expect(out).to include("Fetching source index from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
end
diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb
index e80385980e..b7cef0b53e 100644
--- a/spec/install/gems/flex_spec.rb
+++ b/spec/install/gems/flex_spec.rb
@@ -193,8 +193,6 @@ RSpec.describe "bundle flex_install" do
it "suggests bundle update when the Gemfile requires different versions than the lock" do
nice_error = <<-E.strip.gsub(/^ {8}/, "")
- Fetching source index from file:#{gem_repo2}/
- Resolving dependencies...
Bundler could not find compatible versions for gem "rack":
In snapshot (Gemfile.lock):
rack (= 0.9.1)
@@ -211,7 +209,7 @@ RSpec.describe "bundle flex_install" do
E
bundle :install, :retry => 0
- expect(out).to eq(nice_error)
+ expect(last_command.bundler_err).to end_with(nice_error)
end
end
diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb
index 1ba54f999e..261286f7e4 100644
--- a/spec/install/gems/resolving_spec.rb
+++ b/spec/install/gems/resolving_spec.rb
@@ -140,9 +140,6 @@ RSpec.describe "bundle install with install-time dependencies" do
expect(out).to_not include("Gem::InstallError: require_ruby requires Ruby version > 9000")
nice_error = strip_whitespace(<<-E).strip
- Fetching gem metadata from http://localgemserver.test/.
- Fetching version metadata from http://localgemserver.test/
- Resolving dependencies...
Bundler could not find compatible versions for gem "ruby\0":
In Gemfile:
ruby\0 (#{error_message_requirement})
@@ -152,7 +149,7 @@ RSpec.describe "bundle install with install-time dependencies" do
Could not find gem 'ruby\0 (> 9000)', which is required by gem 'require_ruby', in any of the sources.
E
- expect(out).to eq(nice_error)
+ expect(last_command.bundler_err).to end_with(nice_error)
end
end
diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb
index 75d70747da..693289c72c 100644
--- a/spec/install/git_spec.rb
+++ b/spec/install/git_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe "bundle install" do
gem "foo", :git => "#{lib_path("foo")}"
G
- bundle :install
+ bundle! :install
expect(out).to include("Using foo 1.0 from #{lib_path("foo")} (at master@#{revision_for(lib_path("foo"))[0..6]})")
expect(the_bundle).to include_gems "foo 1.0", :source => "git@#{lib_path("foo")}"
end
@@ -31,7 +31,7 @@ RSpec.describe "bundle install" do
update_git "foo", "4.0", :path => lib_path("foo"), :gemspec => true
- bundle! :update
+ bundle! :update, :all => bundle_update_requires_all?
expect(out).to include("Using foo 2.0 (was 1.0) from #{lib_path("foo")} (at master~2@#{rev2})")
expect(the_bundle).to include_gems "foo 2.0", :source => "git@#{lib_path("foo")}"
end