diff options
author | Bundlerbot <bot@bundler.io> | 2020-01-23 13:37:00 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2020-01-23 13:37:00 +0000 |
commit | 524f524362666cb80700430b9f3740f38befb027 (patch) | |
tree | 265fddd19ac4f17a5a0c6f54fb952419e9674632 /spec | |
parent | 12b786888e630a6141273d28b74ec4b2e075cc44 (diff) | |
parent | 7aa323a8396782b351e95bfa3f3456bd2db3c682 (diff) | |
download | bundler-524f524362666cb80700430b9f3740f38befb027.tar.gz |
Merge #7527
7527: Report original exception when failing to load openssl r=deivid-rodriguez a=p-mongo
### What was the end-user problem that led to this PR?
See #7192.
### What was your diagnosis of the problem?
Bundler discards `LoadError` class and message when reporting it.
### What is your fix for the problem, implemented in this PR?
Report class and message of the original exception when reporting `LoadError`.
Fixes #7192
Co-authored-by: Oleg Pudeyev <oleg@bsdpower.com>
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
Co-authored-by: Emily Giurleo <e.m.giurleo@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/friendly_errors_spec.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/spec/bundler/friendly_errors_spec.rb b/spec/bundler/friendly_errors_spec.rb index 82553a3ca7..e7addda3f2 100644 --- a/spec/bundler/friendly_errors_spec.rb +++ b/spec/bundler/friendly_errors_spec.rb @@ -115,8 +115,12 @@ RSpec.describe Bundler, "friendly errors" do context "LoadError" do let(:error) { LoadError.new("cannot load such file -- openssl") } + before do + allow(error).to receive(:backtrace).and_return(["backtrace"]) + end + it "Bundler.ui receive error" do - expect(Bundler.ui).to receive(:error).with("\nCould not load OpenSSL.") + expect(Bundler.ui).to receive(:error).with("\nCould not load OpenSSL. LoadError: cannot load such file -- openssl\nbacktrace") Bundler::FriendlyErrors.log_error(error) end @@ -124,11 +128,6 @@ RSpec.describe Bundler, "friendly errors" do expect(Bundler.ui).to receive(:warn).with(any_args, :wrap => true) Bundler::FriendlyErrors.log_error(error) end - - it "Bundler.ui receive trace" do - expect(Bundler.ui).to receive(:trace).with(error) - Bundler::FriendlyErrors.log_error(error) - end end context "Interrupt" do |