summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/bundler/cli_spec.rb4
-rw-r--r--spec/cache/cache_path_spec.rb2
-rw-r--r--spec/commands/binstubs_spec.rb4
-rw-r--r--spec/commands/check_spec.rb19
-rw-r--r--spec/commands/clean_spec.rb2
-rw-r--r--spec/commands/console_spec.rb2
-rw-r--r--spec/install/deploy_spec.rb12
-rw-r--r--spec/install/path_spec.rb4
-rw-r--r--spec/install/post_bundle_message_spec.rb2
-rw-r--r--spec/lock/lockfile_spec.rb12
-rw-r--r--spec/other/platform_spec.rb96
-rw-r--r--spec/runtime/setup_spec.rb2
12 files changed, 79 insertions, 82 deletions
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 06933528f7..2da1d4c46d 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -3,12 +3,12 @@ require "bundler/cli"
describe "bundle executable" do
it "returns non-zero exit status when passed unrecognized options" do
- bundle "--invalid_argument"
+ bundle "--invalid_argument", :expect_err => true
expect(exitstatus).to_not be_zero if exitstatus
end
it "returns non-zero exit status when passed unrecognized task" do
- bundle "unrecognized-tast"
+ bundle "unrecognized-tast", :expect_err => true
expect(exitstatus).to_not be_zero if exitstatus
end
diff --git a/spec/cache/cache_path_spec.rb b/spec/cache/cache_path_spec.rb
index 62076e7b36..d4243a16e4 100644
--- a/spec/cache/cache_path_spec.rb
+++ b/spec/cache/cache_path_spec.rb
@@ -25,7 +25,7 @@ describe "bundle package" do
context "when given an absolute path" do
it "exits with non-zero status" do
- bundle :package, "cache-path" => "/tmp/cache-foo"
+ bundle :package, "cache-path" => "/tmp/cache-foo", :expect_err => true
expect(err).to match(/must be relative/)
expect(exitstatus).to eq(15) if exitstatus
end
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb
index 0ca83624ad..c16049aca3 100644
--- a/spec/commands/binstubs_spec.rb
+++ b/spec/commands/binstubs_spec.rb
@@ -45,7 +45,7 @@ describe "bundle binstubs <gem>" do
gem "rack"
G
- bundle "binstubs"
+ bundle "binstubs", :expect_err => true
expect(exitstatus).to eq(1) if exitstatus
expect(err).to include("`bundle binstubs` needs at least one gem to run.")
end
@@ -111,7 +111,7 @@ describe "bundle binstubs <gem>" do
source "file://#{gem_repo1}"
G
- bundle "binstubs doesnt_exist"
+ bundle "binstubs doesnt_exist", :expect_err => true
expect(exitstatus).to eq(7) if exitstatus
expect(err).to include("Could not find gem 'doesnt_exist'.")
diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb
index 0f039c067e..3f7eb24e05 100644
--- a/spec/commands/check_spec.rb
+++ b/spec/commands/check_spec.rb
@@ -57,7 +57,7 @@ describe "bundle check" do
gem "rails"
G
- bundle :check
+ bundle :check, :expect_err => true
expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.")
end
@@ -67,7 +67,7 @@ describe "bundle check" do
gem "rails"
G
- bundle :check
+ bundle :check, :expect_err => true
expect(exitstatus).to be > 0 if exitstatus
expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.")
end
@@ -88,7 +88,7 @@ describe "bundle check" do
gem "rails_fail"
G
- bundle :check
+ bundle :check, :expect_err => true
expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.")
end
@@ -119,7 +119,7 @@ describe "bundle check" do
gem "rack"
G
- bundle "check"
+ bundle "check", :expect_err => true
expect(err).to include("* rack (1.0.0)")
expect(exitstatus).to eq(1) if exitstatus
end
@@ -187,13 +187,13 @@ describe "bundle check" do
end
it "outputs an error when the default Gemfile is not found" do
- bundle :check
+ bundle :check, :expect_err => true
expect(exitstatus).to eq(10) if exitstatus
expect(err).to include("Could not locate Gemfile")
end
it "does not output fatal error message" do
- bundle :check
+ bundle :check, :expect_err => true
expect(exitstatus).to eq(10) if exitstatus
expect(err).not_to include("Unfortunately, a fatal error has occurred. ")
end
@@ -224,7 +224,7 @@ describe "bundle check" do
bundle "install --deployment"
FileUtils.rm(bundled_app("Gemfile.lock"))
- bundle :check
+ bundle :check, :expect_err => true
expect(exitstatus).not_to eq(0) if exitstatus
end
@@ -259,7 +259,7 @@ describe "bundle check" do
gem "rails"
G
- bundle "check --path vendor/bundle"
+ bundle "check --path vendor/bundle", :expect_err => true
expect(exitstatus).to eq(1) if exitstatus
expect(err).to match(/The following gems are missing/)
end
@@ -283,7 +283,7 @@ describe "bundle check" do
it "shows what is missing with the current Gemfile if it is not satisfied" do
simulate_new_machine
- bundle :check
+ bundle :check, :expect_err => true
expect(err).to match(/The following gems are missing/)
expect(err).to include("* rack (1.0")
end
@@ -331,7 +331,6 @@ describe "bundle check" do
lockfile lock_with(Bundler::VERSION.succ)
bundle :check
expect(out).to include("Bundler is older than the version that created the lockfile")
- expect(err).to lack_errors
lockfile_should_be lock_with(Bundler::VERSION.succ)
end
end
diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb
index e2655d098c..7618c1a207 100644
--- a/spec/commands/clean_spec.rb
+++ b/spec/commands/clean_spec.rb
@@ -281,7 +281,7 @@ describe "bundle clean" do
gem "rack", "1.0.0"
G
- bundle :clean
+ bundle :clean, :expect_err => true
expect(exitstatus).to eq(1) if exitstatus
expect(err).to include("--force")
diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb
index ba835b0603..85008e8303 100644
--- a/spec/commands/console_spec.rb
+++ b/spec/commands/console_spec.rb
@@ -40,7 +40,7 @@ describe "bundle console" do
end
it "doesn't load any other groups" do
- bundle "console" do |input|
+ bundle "console", :expect_err => true do |input|
input.puts("puts ACTIVESUPPORT")
input.puts("exit")
end
diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb
index ada7e52fd9..bf1c7f81ae 100644
--- a/spec/install/deploy_spec.rb
+++ b/spec/install/deploy_spec.rb
@@ -114,7 +114,7 @@ describe "install with --deployment or --frozen" do
gem "rack-obama"
G
- bundle "install --deployment"
+ bundle "install --deployment", :expect_err => true
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile")
expect(err).to include("* rack-obama")
@@ -159,7 +159,7 @@ describe "install with --deployment or --frozen" do
gem "rack-obama"
G
- bundle "install --frozen"
+ bundle "install --frozen", :expect_err => true
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile")
expect(err).to include("* rack-obama")
@@ -173,7 +173,7 @@ describe "install with --deployment or --frozen" do
gem "activesupport"
G
- bundle "install --deployment"
+ bundle "install --deployment", :expect_err => true
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile:\n* activesupport\n\n")
expect(err).to include("You have deleted from the Gemfile:\n* rack")
@@ -186,7 +186,7 @@ describe "install with --deployment or --frozen" do
gem "rack", :git => "git://hubz.com"
G
- bundle "install --deployment"
+ bundle "install --deployment", :expect_err => true
expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
expect(err).not_to include("You have changed in the Gemfile")
@@ -205,7 +205,7 @@ describe "install with --deployment or --frozen" do
gem "rack"
G
- bundle "install --deployment"
+ bundle "install --deployment", :expect_err => true
expect(err).to include("deployment mode")
expect(err).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master)")
expect(err).not_to include("You have added to the Gemfile")
@@ -228,7 +228,7 @@ describe "install with --deployment or --frozen" do
gem "foo", :git => "#{lib_path("rack")}"
G
- bundle "install --deployment"
+ bundle "install --deployment", :expect_err => true
expect(err).to include("deployment mode")
expect(err).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`")
expect(err).not_to include("You have added to the Gemfile")
diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb
index 8ec8f2c50b..7fe915d529 100644
--- a/spec/install/path_spec.rb
+++ b/spec/install/path_spec.rb
@@ -36,7 +36,7 @@ describe "bundle install" do
end
it "disallows --path vendor/bundle --system" do
- bundle "install --path vendor/bundle --system"
+ bundle "install --path vendor/bundle --system", :expect_err => true
expect(err).to include("Please choose.")
end
@@ -145,7 +145,7 @@ describe "bundle install" do
gem "rack"
G
- bundle "install --path bundle"
+ bundle "install --path bundle", :expect_err => true
expect(err).to match(/invalid symlink/)
end
end
diff --git a/spec/install/post_bundle_message_spec.rb b/spec/install/post_bundle_message_spec.rb
index 0475044696..6710a811eb 100644
--- a/spec/install/post_bundle_message_spec.rb
+++ b/spec/install/post_bundle_message_spec.rb
@@ -84,7 +84,7 @@ 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
diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb
index 0b59692718..64062640e8 100644
--- a/spec/lock/lockfile_spec.rb
+++ b/spec/lock/lockfile_spec.rb
@@ -168,7 +168,7 @@ describe "the lockfile format" do
L
simulate_bundler_version "9999999.0.0" do
- install_gemfile <<-G
+ install_gemfile <<-G, :expect_err => true
source "file://#{gem_repo1}"
gem "rack"
@@ -213,7 +213,7 @@ describe "the lockfile format" do
9999999.0.0
L
- install_gemfile <<-G
+ install_gemfile <<-G, :expect_err => true
source "file://#{gem_repo1}"
gem "rack"
@@ -248,7 +248,7 @@ describe "the lockfile format" do
9999999.0.0
L
- install_gemfile <<-G
+ install_gemfile <<-G, :expect_err => true
source 'https://rubygems.org'
gem 'rake'
@@ -361,7 +361,7 @@ describe "the lockfile format" do
it "generates a lockfile wihout credentials for a configured source" do
bundle "config http://localgemserver.test/ user:pass"
- install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
+ install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true, :expect_err => true)
source "http://localgemserver.test/"
source "http://user:pass@othergemserver.test/"
@@ -1080,7 +1080,7 @@ describe "the lockfile format" do
end
it "raises if two different versions are used" do
- install_gemfile <<-G
+ install_gemfile <<-G, :expect_err => true
source "file://#{gem_repo1}"
gem "rack", "1.0"
gem "rack", "1.1"
@@ -1091,7 +1091,7 @@ describe "the lockfile format" do
end
it "raises if two different sources are used" do
- install_gemfile <<-G
+ install_gemfile <<-G, :expect_err => true
source "file://#{gem_repo1}"
gem "rack"
gem "rack", :git => "git://hubz.com"
diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb
index 79c09573a6..f31c069ed8 100644
--- a/spec/other/platform_spec.rb
+++ b/spec/other/platform_spec.rb
@@ -151,7 +151,7 @@ G
gem "foo"
G
- bundle "platform"
+ bundle "platform", :expect_err => true
expect(exitstatus).not_to eq(0) if exitstatus
end
@@ -164,7 +164,7 @@ G
gem "foo"
G
- bundle "platform"
+ bundle "platform", :expect_err => true
expect(exitstatus).not_to eq(0) if exitstatus
end
@@ -177,7 +177,7 @@ G
gem "foo"
G
- bundle "platform"
+ bundle "platform", :expect_err => true
expect(exitstatus).not_to eq(0) if exitstatus
end
@@ -189,8 +189,7 @@ G
gem "foo"
G
- bundle "platform --ruby"
- puts err
+ bundle "platform --ruby", :expect_err => true
expect(out).to eq("No ruby version specified")
end
@@ -267,7 +266,7 @@ G
end
it "doesn't install when the ruby version doesn't match" do
- install_gemfile <<-G
+ install_gemfile <<-G, :expect_err => true
source "file://#{gem_repo1}"
gem "rack"
@@ -279,7 +278,7 @@ G
end
it "doesn't install when engine doesn't match" do
- install_gemfile <<-G
+ install_gemfile <<-G, :expect_err => true
source "file://#{gem_repo1}"
gem "rack"
@@ -292,7 +291,7 @@ G
it "doesn't install when engine version doesn't match" do
simulate_ruby_engine "jruby" do
- install_gemfile <<-G
+ install_gemfile <<-G, :expect_err => true
source "file://#{gem_repo1}"
gem "rack"
@@ -305,7 +304,7 @@ G
end
it "doesn't install when patchlevel doesn't match" do
- install_gemfile <<-G
+ install_gemfile <<-G, :expect_err => true
source "file://#{gem_repo1}"
gem "rack"
@@ -332,7 +331,6 @@ G
G
bundle :check
- expect(exitstatus).to eq(0) if exitstatus
expect(out).to eq("The Gemfile's dependencies are satisfied")
end
@@ -369,7 +367,7 @@ G
#{ruby_version_incorrect}
G
- bundle :check
+ bundle :check, :expect_err => true
should_be_ruby_version_incorrect
end
@@ -386,7 +384,7 @@ G
#{engine_incorrect}
G
- bundle :check
+ bundle :check, :expect_err => true
should_be_engine_incorrect
end
@@ -404,7 +402,7 @@ G
#{engine_version_incorrect}
G
- bundle :check
+ bundle :check, :expect_err => true
should_be_engine_version_incorrect
end
end
@@ -422,7 +420,7 @@ G
#{patchlevel_incorrect}
G
- bundle :check
+ bundle :check, :expect_err => true
should_be_patchlevel_incorrect
end
end
@@ -484,7 +482,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update
+ bundle :update, :expect_err => true
should_be_ruby_version_incorrect
end
@@ -500,7 +498,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update
+ bundle :update, :expect_err => true
should_be_engine_incorrect
end
@@ -517,7 +515,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update
+ bundle :update, :expect_err => true
should_be_engine_version_incorrect
end
end
@@ -533,7 +531,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update
+ bundle :update, :expect_err => true
should_be_patchlevel_incorrect
end
end
@@ -586,7 +584,7 @@ G
#{ruby_version_incorrect}
G
- bundle "show rails"
+ bundle "show rails", :expect_err => true
should_be_ruby_version_incorrect
end
@@ -598,7 +596,7 @@ G
#{engine_incorrect}
G
- bundle "show rails"
+ bundle "show rails", :expect_err => true
should_be_engine_incorrect
end
@@ -611,7 +609,7 @@ G
#{engine_version_incorrect}
G
- bundle "show rails"
+ bundle "show rails", :expect_err => true
should_be_engine_version_incorrect
end
end
@@ -627,7 +625,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle "show rails"
+ bundle "show rails", :expect_err => true
should_be_patchlevel_incorrect
end
end
@@ -660,7 +658,7 @@ G
#{ruby_version_correct_engineless}
G
- bundle :cache
+ bundle :cache, :expect_err => true
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
end
end
@@ -672,7 +670,7 @@ G
#{ruby_version_incorrect}
G
- bundle :cache
+ bundle :cache, :expect_err => true
should_be_ruby_version_incorrect
end
@@ -683,7 +681,7 @@ G
#{engine_incorrect}
G
- bundle :cache
+ bundle :cache, :expect_err => true
should_be_engine_incorrect
end
@@ -695,7 +693,7 @@ G
#{engine_version_incorrect}
G
- bundle :cache
+ bundle :cache, :expect_err => true
should_be_engine_version_incorrect
end
end
@@ -708,7 +706,7 @@ G
#{patchlevel_incorrect}
G
- bundle :cache
+ bundle :cache, :expect_err => true
should_be_patchlevel_incorrect
end
end
@@ -753,7 +751,7 @@ G
#{ruby_version_incorrect}
G
- bundle :pack
+ bundle :pack, :expect_err => true
should_be_ruby_version_incorrect
end
@@ -764,7 +762,7 @@ G
#{engine_incorrect}
G
- bundle :pack
+ bundle :pack, :expect_err => true
should_be_engine_incorrect
end
@@ -776,7 +774,7 @@ G
#{engine_version_incorrect}
G
- bundle :pack
+ bundle :pack, :expect_err => true
should_be_engine_version_incorrect
end
end
@@ -789,7 +787,7 @@ G
#{patchlevel_incorrect}
G
- bundle :pack
+ bundle :pack, :expect_err => true
should_be_patchlevel_incorrect
end
end
@@ -831,7 +829,7 @@ G
#{ruby_version_incorrect}
G
- bundle "exec rackup"
+ bundle "exec rackup", :expect_err => true
should_be_ruby_version_incorrect
end
@@ -842,7 +840,7 @@ G
#{engine_incorrect}
G
- bundle "exec rackup"
+ bundle "exec rackup", :expect_err => true
should_be_engine_incorrect
end
@@ -867,7 +865,7 @@ G
#{patchlevel_incorrect}
G
- bundle "exec rackup"
+ bundle "exec rackup", :expect_err => true
should_be_patchlevel_incorrect
end
end
@@ -928,7 +926,7 @@ G
#{ruby_version_incorrect}
G
- bundle "console"
+ bundle "console", :expect_err => true
should_be_ruby_version_incorrect
end
@@ -942,7 +940,7 @@ G
#{engine_incorrect}
G
- bundle "console"
+ bundle "console", :expect_err => true
should_be_engine_incorrect
end
@@ -957,7 +955,7 @@ G
#{engine_version_incorrect}
G
- bundle "console"
+ bundle "console", :expect_err => true
should_be_engine_version_incorrect
end
end
@@ -972,7 +970,7 @@ G
#{patchlevel_incorrect}
G
- bundle "console"
+ bundle "console", :expect_err => true
should_be_patchlevel_incorrect
end
end
@@ -1031,7 +1029,7 @@ G
FileUtils.rm(bundled_app("Gemfile.lock"))
- ruby <<-R
+ ruby <<-R, :expect_err => true
require 'rubygems'
require 'bundler/setup'
R
@@ -1051,7 +1049,7 @@ G
FileUtils.rm(bundled_app("Gemfile.lock"))
- ruby <<-R
+ ruby <<-R, :expect_err => true
require 'rubygems'
require 'bundler/setup'
R
@@ -1072,7 +1070,7 @@ G
FileUtils.rm(bundled_app("Gemfile.lock"))
- ruby <<-R
+ ruby <<-R, :expect_err => true
require 'rubygems'
require 'bundler/setup'
R
@@ -1094,7 +1092,7 @@ G
FileUtils.rm(bundled_app("Gemfile.lock"))
- ruby <<-R
+ ruby <<-R, :expect_err => true
require 'rubygems'
require 'bundler/setup'
R
@@ -1131,7 +1129,7 @@ G
#{ruby_version_correct}
G
- bundle "outdated"
+ bundle "outdated", :expect_err => true
expect(out).to include("activesupport (newest 3.0, installed 2.3.5, requested = 2.3.5")
expect(out).to include("foo (newest 1.0")
end
@@ -1151,7 +1149,7 @@ G
#{ruby_version_correct_engineless}
G
- bundle "outdated"
+ bundle "outdated", :expect_err => true
expect(out).to include("activesupport (newest 3.0, installed 2.3.5, requested = 2.3.5)")
expect(out).to include("foo (newest 1.0")
end
@@ -1171,7 +1169,7 @@ G
#{ruby_version_incorrect}
G
- bundle "outdated"
+ bundle "outdated", :expect_err => true
should_be_ruby_version_incorrect
end
@@ -1189,7 +1187,7 @@ G
#{engine_incorrect}
G
- bundle "outdated"
+ bundle "outdated", :expect_err => true
should_be_engine_incorrect
end
@@ -1208,7 +1206,7 @@ G
#{engine_version_incorrect}
G
- bundle "outdated"
+ bundle "outdated", :expect_err => true
should_be_engine_version_incorrect
end
end
@@ -1228,7 +1226,7 @@ G
#{patchlevel_incorrect}
G
- bundle "outdated"
+ bundle "outdated", :expect_err => true
should_be_patchlevel_incorrect
end
end
@@ -1248,7 +1246,7 @@ G
#{patchlevel_fixnum}
G
- bundle "outdated"
+ bundle "outdated", :expect_err => true
should_be_patchlevel_fixnum
end
end
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index 509076687a..78c4cb7324 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -865,7 +865,7 @@ describe "Bundler.setup" do
update_git "bar", :gemspec => false do |s|
s.write "bar.gemspec", "require 'foobarbaz'"
end
- bundle :install
+ bundle :install, :expect_err => true
expect(err).to include("was a LoadError while loading bar.gemspec")
expect(err).to include("foobarbaz")
expect(err).to include("bar.gemspec:1")