diff options
author | schneems <richard.schneeman@gmail.com> | 2013-09-22 10:48:59 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2013-09-28 14:24:01 -0500 |
commit | a5d870fc6dc166c43a377870bf68e77dfe16f5cf (patch) | |
tree | d99fa366f5da8660e097a5e1e86ef72f2e61beb1 /spec | |
parent | dc7dd9a222cf45732b61604529a11483b7e91ce8 (diff) | |
download | bundler-a5d870fc6dc166c43a377870bf68e77dfe16f5cf.tar.gz |
Retry git commands
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/retry_spec.rb | 7 | ||||
-rw-r--r-- | spec/install/gems/flex_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/invalid_spec.rb | 2 | ||||
-rw-r--r-- | spec/runtime/load_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers.rb | 3 |
5 files changed, 9 insertions, 7 deletions
diff --git a/spec/bundler/retry_spec.rb b/spec/bundler/retry_spec.rb index ffc6306439..5f3bd859cf 100644 --- a/spec/bundler/retry_spec.rb +++ b/spec/bundler/retry_spec.rb @@ -24,13 +24,14 @@ describe "bundle retry" do end it "raises the last error" do + error = Bundler::GemfileNotFound attempts = 0 expect { Bundler::Retry.new(nil, 3).attempt do attempts += 1 - raise Bundler::GemfileNotFound + raise error end - }.to raise_error(Bundler::GemfileNotFound) - expect(attempts).to eq(3) + }.to raise_error(error) + expect(attempts).to eq(4) end end diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb index 9a837e953f..dbf9278af7 100644 --- a/spec/install/gems/flex_spec.rb +++ b/spec/install/gems/flex_spec.rb @@ -207,7 +207,7 @@ describe "bundle flex_install" do the gems in your Gemfile, which may resolve the conflict. E - bundle :install + bundle :install, :retry => 0 expect(out).to eq(nice_error) end end diff --git a/spec/install/invalid_spec.rb b/spec/install/invalid_spec.rb index 9ce049714c..3dd8a4ff72 100644 --- a/spec/install/invalid_spec.rb +++ b/spec/install/invalid_spec.rb @@ -41,7 +41,7 @@ describe "invalid or inaccessible gem source" do gem "rack" gem "signed_gem" G - bundle "install --retry 3" + bundle "install", :retry => 2 exp = Regexp.escape("Retrying source fetch due to error (2/3)") expect(out).to match(exp) exp = Regexp.escape("Retrying source fetch due to error (3/3)") diff --git a/spec/runtime/load_spec.rb b/spec/runtime/load_spec.rb index 086145d46d..8a53be561f 100644 --- a/spec/runtime/load_spec.rb +++ b/spec/runtime/load_spec.rb @@ -32,7 +32,7 @@ describe "Bundler.load" do expect { ENV['BUNDLE_GEMFILE'] = "" Bundler.load - }.not_to raise_error(Bundler::GemfileNotFound) + }.not_to raise_error() end end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index ec9cf27e60..610de2d855 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -56,7 +56,7 @@ module Spec end def bundle(cmd, options = {}) - expect_err = options.delete(:expect_err) + expect_err = options.delete(:expect_err) exitstatus = options.delete(:exitstatus) options["no-color"] = true unless options.key?("no-color") || %w(exec conf).include?(cmd.to_s[0..3]) @@ -190,6 +190,7 @@ module Spec def install_gemfile(*args) gemfile(*args) opts = args.last.is_a?(Hash) ? args.last : {} + opts[:retry] ||= 0 bundle :install, opts end |