diff options
author | Sava Virtosu <savionok@gmail.com> | 2017-01-28 21:51:14 +0200 |
---|---|---|
committer | Sava Virtosu <savionok@gmail.com> | 2017-01-28 21:51:14 +0200 |
commit | 3f0a5b718e49bcffb0200d05ce2c537301eb2b32 (patch) | |
tree | 940de85a6ba9af7712a0d43f2477fd29af9a8614 /spec/bundler | |
parent | 5856d0c8ed250e27234970044263340533c22ad1 (diff) | |
download | bundler-3f0a5b718e49bcffb0200d05ce2c537301eb2b32.tar.gz |
fix syntax error on 1.8.7
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/friendly_errors_spec.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/spec/bundler/friendly_errors_spec.rb b/spec/bundler/friendly_errors_spec.rb index 47b55f4255..19799d5495 100644 --- a/spec/bundler/friendly_errors_spec.rb +++ b/spec/bundler/friendly_errors_spec.rb @@ -65,7 +65,7 @@ RSpec.describe Bundler, "friendly errors" do end describe "#log_error" do - shared_examples "Bundler.ui receive error" do |error, message = nil| + shared_examples "Bundler.ui receive error" do |error, message| it "" do expect(Bundler.ui).to receive(:error).with(message || error.message) Bundler::FriendlyErrors.log_error(error) @@ -128,23 +128,29 @@ RSpec.describe Bundler, "friendly errors" do end context "LoadError" do - it_behaves_like "Bundler.ui receive error", LoadError.new("cannot load such file -- openssl"), "\nCould not load OpenSSL." + let(:error) { LoadError.new("cannot load such file -- openssl") } + + it "Bundler.ui receive error" do + expect(Bundler.ui).to receive(:error).with("\nCould not load OpenSSL.") + Bundler::FriendlyErrors.log_error(error) + end it "Bundler.ui receive warn" do - error = LoadError.new("cannot load such file -- openssl") expect(Bundler.ui).to receive(:warn).with(any_args, :wrap => true) Bundler::FriendlyErrors.log_error(error) end it "Bundler.ui receive trace" do - error = LoadError.new("cannot load such file -- openssl") expect(Bundler.ui).to receive(:trace).with(error) Bundler::FriendlyErrors.log_error(error) end end context "Interrupt" do - it_behaves_like "Bundler.ui receive error", Interrupt.new, "\nQuitting..." + it "Bundler.ui receive error" do + expect(Bundler.ui).to receive(:error).with("\nQuitting...") + Bundler::FriendlyErrors.log_error(Interrupt.new) + end it_behaves_like "Bundler.ui receive trace", Interrupt.new end |