diff --git a/bundler/lib/bundler/friendly_errors.rb b/bundler/lib/bundler/friendly_errors.rb index b4d347727cb5..827306469988 100644 --- a/bundler/lib/bundler/friendly_errors.rb +++ b/bundler/lib/bundler/friendly_errors.rb @@ -51,7 +51,7 @@ def exit_status(error) end def request_issue_report_for(e) - Bundler.ui.info <<-EOS.gsub(/^ {8}/, "") + Bundler.ui.error <<-EOS.gsub(/^ {8}/, ""), nil, nil --- ERROR REPORT TEMPLATE ------------------------------------------------------- # Error Report @@ -94,7 +94,7 @@ def request_issue_report_for(e) Bundler.ui.error "Unfortunately, an unexpected error occurred, and Bundler cannot continue." - Bundler.ui.warn <<-EOS.gsub(/^ {8}/, "") + Bundler.ui.error <<-EOS.gsub(/^ {8}/, ""), nil, :yellow First, try this link to see if there are any existing issue reports for this error: #{issues_url(e)} diff --git a/bundler/lib/bundler/ui/shell.rb b/bundler/lib/bundler/ui/shell.rb index 51e36ed3ec99..17777af4acb0 100644 --- a/bundler/lib/bundler/ui/shell.rb +++ b/bundler/lib/bundler/ui/shell.rb @@ -28,17 +28,17 @@ def confirm(msg, newline = nil) tell_me(msg, :green, newline) if level("confirm") end - def warn(msg, newline = nil) + def warn(msg, newline = nil, color = :yellow) return unless level("warn") return if @warning_history.include? msg @warning_history << msg - tell_err(msg, :yellow, newline) + tell_err(msg, color, newline) end - def error(msg, newline = nil) + def error(msg, newline = nil, color = :red) return unless level("error") - tell_err(msg, :red, newline) + tell_err(msg, color, newline) end def debug(msg, newline = nil) diff --git a/bundler/spec/bundler/friendly_errors_spec.rb b/bundler/spec/bundler/friendly_errors_spec.rb index d6496db6ae8e..496191f89187 100644 --- a/bundler/spec/bundler/friendly_errors_spec.rb +++ b/bundler/spec/bundler/friendly_errors_spec.rb @@ -193,9 +193,9 @@ class OutOfMemoryError < StandardError; end describe "#request_issue_report_for" do it "calls relevant methods for Bundler.ui" do - expect(Bundler.ui).to receive(:info) - expect(Bundler.ui).to receive(:error) - expect(Bundler.ui).to receive(:warn) + expect(Bundler.ui).not_to receive(:info) + expect(Bundler.ui).to receive(:error).exactly(3).times + expect(Bundler.ui).not_to receive(:warn) Bundler::FriendlyErrors.request_issue_report_for(StandardError.new) end