diff options
author | Andre Arko <andre@arko.net> | 2015-01-20 22:51:56 -0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-01-20 22:51:56 -0800 |
commit | 8774e0062e44a45819fde6e38465f0bb2f5de36c (patch) | |
tree | 3faacb40cab055fa96d2b77f9713e33a6b2f1b61 /spec | |
parent | f41a4ed9963ac66fbbcb47ff8bbf6d838e355f1b (diff) | |
download | bundler-8774e0062e44a45819fde6e38465f0bb2f5de36c.tar.gz |
don’t test exitstatus when it is unknown
apparently on some Ruby 1.8.7 installs, open3 doesn’t return an exit
status, and that includes all Travis installs of 1.8.7. :/ these tests
all pass (while checking exit status) on my machine, but they shouldn’t
fail if the Ruby on Travis isn’t able to provide exitstatuses.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/cli_spec.rb | 6 | ||||
-rw-r--r-- | spec/cache/platform_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/binstubs_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/check_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/clean_spec.rb | 8 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 6 | ||||
-rw-r--r-- | spec/commands/outdated_spec.rb | 6 | ||||
-rw-r--r-- | spec/install/deploy_spec.rb | 18 | ||||
-rw-r--r-- | spec/install/gemfile/git_spec.rb | 8 | ||||
-rw-r--r-- | spec/install/gemfile/path_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/gemfile/svn_spec.rb | 6 | ||||
-rw-r--r-- | spec/install/gems/dependency_api_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/gems/platform_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/simple_case_spec.rb | 8 | ||||
-rw-r--r-- | spec/install/gems/sources_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/security_policy_spec.rb | 8 | ||||
-rw-r--r-- | spec/other/bundle_ruby_spec.rb | 6 | ||||
-rw-r--r-- | spec/other/platform_spec.rb | 30 | ||||
-rw-r--r-- | spec/realworld/edgecases_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers.rb | 2 | ||||
-rw-r--r-- | spec/update/git_spec.rb | 2 |
21 files changed, 69 insertions, 69 deletions
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb index ed703990ca..7917726efe 100644 --- a/spec/bundler/cli_spec.rb +++ b/spec/bundler/cli_spec.rb @@ -6,12 +6,12 @@ describe "bundle executable" do it "returns non-zero exit status when passed unrecognized options" do bundle '--invalid_argument' - expect(exitstatus).to_not be_zero + expect(exitstatus).to_not be_zero if exitstatus end it "returns non-zero exit status when passed unrecognized task" do bundle 'unrecognized-tast' - expect(exitstatus).to_not be_zero + expect(exitstatus).to_not be_zero if exitstatus end it "looks for a binary and executes it if it's named bundler-<task>" do @@ -23,7 +23,7 @@ describe "bundle executable" do bundle 'testtasks' end - expect(exitstatus).to be_zero + expect(exitstatus).to be_zero if exitstatus expect(out).to eq('Hello, world') end end diff --git a/spec/cache/platform_spec.rb b/spec/cache/platform_spec.rb index b79ecb08d9..6b73f90f05 100644 --- a/spec/cache/platform_spec.rb +++ b/spec/cache/platform_spec.rb @@ -36,7 +36,7 @@ describe "bundle cache with multiple platforms" do it "ensures that a succesful bundle install does not delete gems for other platforms" do bundle "install" - expect(exitstatus).to eq 0 + expect(exitstatus).to eq 0 if exitstatus expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist @@ -45,7 +45,7 @@ describe "bundle cache with multiple platforms" do it "ensures that a succesful bundle update does not delete gems for other platforms" do bundle "update" - expect(exitstatus).to eq 0 + expect(exitstatus).to eq 0 if exitstatus expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index 646fe33c40..947b0beea3 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -46,7 +46,7 @@ describe "bundle binstubs <gem>" do G bundle "binstubs" - expect(exitstatus).to eq(1) + expect(exitstatus).to eq(1) if exitstatus expect(out).to eq("`bundle binstubs` needs at least one gem to run.") end @@ -128,7 +128,7 @@ describe "bundle binstubs <gem>" do bundle "binstubs doesnt_exist" - expect(exitstatus).to eq(7) + expect(exitstatus).to eq(7) if exitstatus expect(out).to eq("Could not find gem 'doesnt_exist'.") end end diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb index 1f4f9b8f53..4291914665 100644 --- a/spec/commands/check_spec.rb +++ b/spec/commands/check_spec.rb @@ -225,7 +225,7 @@ describe "bundle check" do FileUtils.rm(bundled_app("Gemfile.lock")) bundle :check - expect(exitstatus).not_to eq(0) + expect(exitstatus).not_to eq(0) if exitstatus end context "--path" do diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index d63b77525f..a9f65745d4 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -307,7 +307,7 @@ describe "bundle clean" do bundle "install --path vendor/bundle --without development" bundle :clean - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "displays an error when used without --path" do @@ -319,7 +319,7 @@ describe "bundle clean" do bundle :clean - expect(exitstatus).to eq(1) + expect(exitstatus).to eq(1) if exitstatus expect(out).to include("--force") end @@ -543,7 +543,7 @@ describe "bundle clean" do sys_exec "foo" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus expect(out).to eq("1.0") end @@ -565,7 +565,7 @@ describe "bundle clean" do bundle "install --path vendor/bundle" bundle :clean - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "doesn't remove gems in dry-run mode" do diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 6deb1fe4fd..d6e1349441 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -190,7 +190,7 @@ describe "bundle exec" do G bundle "exec foobarbaz" - expect(exitstatus).to eq(127) + expect(exitstatus).to eq(127) if exitstatus expect(out).to include("bundler: command not found: foobarbaz") expect(out).to include("Install missing gem executables with `bundle install`") end @@ -202,7 +202,7 @@ describe "bundle exec" do bundle "exec touch foo" bundle "exec ./foo" - expect(exitstatus).to eq(126) + expect(exitstatus).to eq(126) if exitstatus expect(out).to include("bundler: not executable: ./foo") end @@ -212,7 +212,7 @@ describe "bundle exec" do G bundle "exec" - expect(exitstatus).to eq(128) + expect(exitstatus).to eq(128) if exitstatus expect(out).to include("bundler: exec needs a command to run") end diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb index d6e2edfc66..4d8e6d5ce1 100644 --- a/spec/commands/outdated_spec.rb +++ b/spec/commands/outdated_spec.rb @@ -44,13 +44,13 @@ describe "bundle outdated" do bundle "outdated" - expect(exitstatus).to_not be_zero + expect(exitstatus).to_not be_zero if exitstatus end it "returns success exit status if no outdated gems present" do bundle "outdated" - expect(exitstatus).to be_zero + expect(exitstatus).to be_zero if exitstatus end end @@ -150,7 +150,7 @@ describe "bundle outdated" do it "returns non-zero exit code" do bundle "outdated invalid_gem_name" - expect(exitstatus).to_not be_zero + expect(exitstatus).to_not be_zero if exitstatus end end diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb index 5a8a41f9a5..5f5420ee98 100644 --- a/spec/install/deploy_spec.rb +++ b/spec/install/deploy_spec.rb @@ -21,7 +21,7 @@ describe "install with --deployment or --frozen" do it "works after you try to deploy without a lock" do bundle "install --deployment" bundle :install - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus should_be_installed "rack 1.0" end @@ -43,7 +43,7 @@ describe "install with --deployment or --frozen" do G bundle :install bundle "install --deployment --without test" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "works if you exclude a group with a svn gem" do @@ -55,14 +55,14 @@ describe "install with --deployment or --frozen" do G bundle :install bundle "install --deployment --without test" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "works when you bundle exec bundle" do bundle :install bundle "install --deployment" bundle "exec bundle check" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "works when using path gems from the same path and the version is specified" do @@ -76,7 +76,7 @@ describe "install with --deployment or --frozen" do bundle :install bundle "install --deployment" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "works when there are credentials in the source URL" do @@ -88,7 +88,7 @@ describe "install with --deployment or --frozen" do bundle "install --deployment", :artifice => "endpoint_strict_basic_authentication" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "works with sources given by a block" do @@ -100,7 +100,7 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus should_be_installed "rack 1.0" end @@ -111,12 +111,12 @@ describe "install with --deployment or --frozen" do it "works with the --deployment flag if you didn't change anything" do bundle "install --deployment" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "works with the --frozen flag if you didn't change anything" do bundle "install --frozen" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "explodes with the --deployment flag if you make a change and don't check in the lockfile" do diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index 607a49ea21..537ae8554f 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -656,7 +656,7 @@ describe "bundle install with git sources" do bundle "install" bundle "install" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "does not duplicate git gem sources" do @@ -760,7 +760,7 @@ describe "bundle install with git sources" do simulate_new_machine bundle "install --deployment" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end end @@ -928,7 +928,7 @@ describe "bundle install with git sources" do end G - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus expect(ENV['GIT_DIR']).to eq('bar') expect(ENV['GIT_WORK_TREE']).to eq('bar') end @@ -961,7 +961,7 @@ describe "bundle install with git sources" do 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 + expect(exitstatus).to be_zero if exitstatus end end end diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb index bf0f29189e..07449201c2 100644 --- a/spec/install/gemfile/path_spec.rb +++ b/spec/install/gemfile/path_spec.rb @@ -79,7 +79,7 @@ describe "bundle install with explicit source paths" do G bundle "install --frozen" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "installs dependencies from the path even if a newer gem is available elsewhere" do @@ -203,7 +203,7 @@ describe "bundle install with explicit source paths" do gemspec :path => "#{lib_path("foo")}" G - expect(exitstatus).to eq(15) + expect(exitstatus).to eq(15) if exitstatus expect(out).to match(/There are multiple gemspecs/) end diff --git a/spec/install/gemfile/svn_spec.rb b/spec/install/gemfile/svn_spec.rb index d1674b2dd5..bfd3a378b4 100644 --- a/spec/install/gemfile/svn_spec.rb +++ b/spec/install/gemfile/svn_spec.rb @@ -394,7 +394,7 @@ describe "bundle install with svn sources" do bundle "install" bundle "install" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "does not duplicate svn gem sources" do @@ -454,7 +454,7 @@ describe "bundle install with svn sources" do simulate_new_machine bundle "install --deployment" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end end @@ -576,7 +576,7 @@ describe "bundle install with svn sources" do bundle "install", :env => {"PATH" => ""} expect(out).to_not include("You need to install svn to be able to use gems from svn repositories.") - expect(exitstatus).to be_zero + expect(exitstatus).to be_zero if exitstatus end end end diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb index bc3c242777..8a625b2493 100644 --- a/spec/install/gems/dependency_api_spec.rb +++ b/spec/install/gems/dependency_api_spec.rb @@ -110,7 +110,7 @@ describe "gemcutter's dependency API" do bundle "install", :artifice => "endpoint" bundle "install --deployment", :artifice => "endpoint" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus should_be_installed("foo 1.0") end @@ -605,7 +605,7 @@ describe "gemcutter's dependency API" do bundle "install", :artifice => "endpoint_marshal_fail" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end end diff --git a/spec/install/gems/platform_spec.rb b/spec/install/gems/platform_spec.rb index b2c7c35233..1d52858011 100644 --- a/spec/install/gems/platform_spec.rb +++ b/spec/install/gems/platform_spec.rb @@ -174,7 +174,7 @@ describe "bundle install with platform conditionals" do G bundle :show - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "does not attempt to install gems from :rbx when using --local" do diff --git a/spec/install/gems/simple_case_spec.rb b/spec/install/gems/simple_case_spec.rb index 918074fadd..759de0884f 100644 --- a/spec/install/gems/simple_case_spec.rb +++ b/spec/install/gems/simple_case_spec.rb @@ -100,7 +100,7 @@ describe "bundle install with gem sources" do source "file://#{gem_repo1}" gem :rack G - expect(exitstatus).to eq(4) + expect(exitstatus).to eq(4) if exitstatus end it "pulls in dependencies" do @@ -324,7 +324,7 @@ describe "bundle install with gem sources" do gem 'foo' G - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end it "doesn't blow up when the global .bundle/config is empty" do @@ -336,7 +336,7 @@ describe "bundle install with gem sources" do gem 'foo' G - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end end @@ -359,7 +359,7 @@ describe "bundle install with gem sources" do bundle :install - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end end diff --git a/spec/install/gems/sources_spec.rb b/spec/install/gems/sources_spec.rb index aee242e54b..0caf6806d6 100644 --- a/spec/install/gems/sources_spec.rb +++ b/spec/install/gems/sources_spec.rb @@ -93,7 +93,7 @@ describe "bundle install with gems on multiple sources" do bundle "install --deployment" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus should_be_installed("rack-obama 1.0.0", "rack 1.0.0") end end diff --git a/spec/install/security_policy_spec.rb b/spec/install/security_policy_spec.rb index 2e4afb02bf..1f48cb9e5a 100644 --- a/spec/install/security_policy_spec.rb +++ b/spec/install/security_policy_spec.rb @@ -17,7 +17,7 @@ describe "policies with unsigned gems" do it "will work after you try to deploy without a lock" do bundle "install --deployment" bundle :install - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus should_be_installed "rack 1.0", "signed_gem 1.0" end @@ -39,7 +39,7 @@ describe "policies with unsigned gems" do it "will succeed with no policy" do bundle "install" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end end @@ -65,13 +65,13 @@ describe "policies with signed gems and no CA" do it "will succeed with Low Security setting, low security accepts self signed gem" do bundle "install --trust-policy=LowSecurity" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus should_be_installed "signed_gem 1.0" end it "will succeed with no policy" do bundle "install" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus should_be_installed "signed_gem 1.0" end end diff --git a/spec/other/bundle_ruby_spec.rb b/spec/other/bundle_ruby_spec.rb index 08d24ee71a..739c3d0ffb 100644 --- a/spec/other/bundle_ruby_spec.rb +++ b/spec/other/bundle_ruby_spec.rb @@ -63,7 +63,7 @@ describe "bundle_ruby" do G bundle_ruby :exitstatus => true - expect(exitstatus).not_to eq(0) + expect(exitstatus).not_to eq(0) if exitstatus bundle_ruby expect(out).to eq("Please define :engine_version") @@ -78,7 +78,7 @@ describe "bundle_ruby" do G bundle_ruby :exitstatus => true - expect(exitstatus).not_to eq(0) + expect(exitstatus).not_to eq(0) if exitstatus bundle_ruby expect(out).to eq("Please define :engine") @@ -93,7 +93,7 @@ describe "bundle_ruby" do G bundle_ruby :exitstatus => true - expect(exitstatus).not_to eq(0) + expect(exitstatus).not_to eq(0) if exitstatus bundle_ruby expect(out).to eq("ruby_version must match the :engine_version for MRI") diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index b15f6b2b8a..a2fc9636a0 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -153,7 +153,7 @@ G bundle "platform" - expect(exitstatus).not_to eq(0) + expect(exitstatus).not_to eq(0) if exitstatus end it "raises an error if engine_version is used but engine is not" do @@ -166,7 +166,7 @@ G bundle "platform" - expect(exitstatus).not_to eq(0) + expect(exitstatus).not_to eq(0) if exitstatus end it "raises an error if engine version doesn't match ruby version for MRI" do @@ -179,7 +179,7 @@ G bundle "platform" - expect(exitstatus).not_to eq(0) + expect(exitstatus).not_to eq(0) if exitstatus end it "should print if no ruby version is specified" do @@ -205,28 +205,28 @@ G let(:patchlevel_incorrect) { "#{ruby_version_correct}, :patchlevel => '#{not_local_patchlevel}'" } let(:patchlevel_fixnum) { "#{ruby_version_correct}, :patchlevel => #{RUBY_PATCHLEVEL}1" } - def should_be_ruby_version_incorrect(opts = {:exitstatus => true}) - expect(exitstatus).to eq(18) if opts[:exitstatus] + def should_be_ruby_version_incorrect + expect(exitstatus).to eq(18) if exitstatus expect(out).to be_include("Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}") end - def should_be_engine_incorrect(opts = {:exitstatus => true}) - expect(exitstatus).to eq(18) if opts[:exitstatus] + def should_be_engine_incorrect + expect(exitstatus).to eq(18) if exitstatus expect(out).to be_include("Your Ruby engine is #{local_ruby_engine}, but your Gemfile specified #{not_local_tag}") end - def should_be_engine_version_incorrect(opts = {:exitstatus => true}) - expect(exitstatus).to eq(18) if opts[:exitstatus] + def should_be_engine_version_incorrect + expect(exitstatus).to eq(18) if exitstatus expect(out).to be_include("Your #{local_ruby_engine} version is #{local_engine_version}, but your Gemfile specified #{local_ruby_engine} #{not_local_engine_version}") end - def should_be_patchlevel_incorrect(opts = {:exitstatus => true}) - expect(exitstatus).to eq(18) if opts[:exitstatus] + def should_be_patchlevel_incorrect + expect(exitstatus).to eq(18) if exitstatus expect(out).to be_include("Your Ruby patchlevel is #{RUBY_PATCHLEVEL}, but your Gemfile specified #{not_local_patchlevel}") end - def should_be_patchlevel_fixnum(opts = {:exitstatus => true}) - expect(exitstatus).to eq(18) if opts[:exitstatus] + def should_be_patchlevel_fixnum + expect(exitstatus).to eq(18) if exitstatus expect(out).to be_include("The Ruby patchlevel in your Gemfile must be a string") end @@ -332,7 +332,7 @@ G G bundle :check - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus expect(out).to eq("The Gemfile's dependencies are satisfied") end @@ -351,7 +351,7 @@ G G bundle :check - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus expect(out).to eq("The Gemfile's dependencies are satisfied") end end diff --git a/spec/realworld/edgecases_spec.rb b/spec/realworld/edgecases_spec.rb index 095bbf0006..15c7697564 100644 --- a/spec/realworld/edgecases_spec.rb +++ b/spec/realworld/edgecases_spec.rb @@ -207,6 +207,6 @@ describe "real world edgecases", :realworld => true do L bundle :install - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index f21a77db55..eb8405fa98 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -130,7 +130,7 @@ module Spec @out = @out_p.read_available_bytes.strip @err = @err_p.read_available_bytes.strip - @exitstatus = wait_thr.value.exitstatus + @exitstatus = wait_thr && wait_thr.value.exitstatus end puts @err unless expect_err || @err.empty? || !$show_err diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb index 0ef857a922..9f5e71b3e2 100644 --- a/spec/update/git_spec.rb +++ b/spec/update/git_spec.rb @@ -114,7 +114,7 @@ describe "bundle update" do G bundle "update" - expect(exitstatus).to eq(0) + expect(exitstatus).to eq(0) if exitstatus end describe "with submodules" do |