diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-12-17 14:22:28 +0100 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-12-18 23:24:41 +0100 |
commit | 5a61b65ad5ec1df1539ecf8bc5d124f2b254ba14 (patch) | |
tree | ed29032c6728086e8f40dc29f9ffcadce2bbf96c | |
parent | 52d803664d44cfb8728d2fecccfcaa8a132a09a7 (diff) | |
download | bundler-5a61b65ad5ec1df1539ecf8bc5d124f2b254ba14.tar.gz |
[Retry] Add newline before printing the final error
-rw-r--r-- | lib/bundler/retry.rb | 5 | ||||
-rw-r--r-- | spec/bundler/retry_spec.rb | 4 | ||||
-rw-r--r-- | spec/realworld/mirror_probe_spec.rb | 1 |
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/bundler/retry.rb b/lib/bundler/retry.rb index a7a72feed5..092fb866b3 100644 --- a/lib/bundler/retry.rb +++ b/lib/bundler/retry.rb @@ -43,7 +43,10 @@ module Bundler def fail_attempt(e) @failed = true - raise e if last_attempt? || @exceptions.any? {|k| e.is_a?(k) } + if last_attempt? || @exceptions.any? {|k| e.is_a?(k) } + Bundler.ui.info "" unless Bundler.ui.debug? + raise e + end return true unless name Bundler.ui.info "" unless Bundler.ui.debug? # Add new line incase dots preceded this Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", Bundler.ui.debug? diff --git a/spec/bundler/retry_spec.rb b/spec/bundler/retry_spec.rb index 665ba9f2df..7f5779a5ca 100644 --- a/spec/bundler/retry_spec.rb +++ b/spec/bundler/retry_spec.rb @@ -65,10 +65,10 @@ describe Bundler::Retry do end end - context "with debugging on" do + context "with debugging off" do it "print error message with newlines" do allow(Bundler.ui).to receive(:debug?).and_return(false) - expect(Bundler.ui).to receive(:info).with("") + expect(Bundler.ui).to receive(:info).with("").twice expect(Bundler.ui).to receive(:warn).with(failure_message, false) expect do diff --git a/spec/realworld/mirror_probe_spec.rb b/spec/realworld/mirror_probe_spec.rb index 22ac04fcba..5a4a4a1b0a 100644 --- a/spec/realworld/mirror_probe_spec.rb +++ b/spec/realworld/mirror_probe_spec.rb @@ -81,7 +81,6 @@ describe "fetching dependencies with a not available mirror", :realworld => true end it "prints each error and warning on a new line" do - gemfile <<-G source "#{original}" gem 'weakling' |