diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2018-12-08 15:53:47 -0800 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2018-12-08 15:53:47 -0800 |
commit | 9b843ed15238565045ff652d9e49b4e92751d659 (patch) | |
tree | c956d0d5eb5613c0c6b2f5978d65d17ffaf95ab1 | |
parent | 0a58f46b7760e009986482814705cd79cea96aa6 (diff) | |
download | bundler-segiddins/allow-rubygems-to-open-files.tar.gz |
Allow files other than Gemfile.lock to be opened in definition specssegiddins/allow-rubygems-to-open-files
-rw-r--r-- | spec/bundler/definition_spec.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/bundler/definition_spec.rb b/spec/bundler/definition_spec.rb index 2ed87ec81d..ceb7b4bf05 100644 --- a/spec/bundler/definition_spec.rb +++ b/spec/bundler/definition_spec.rb @@ -13,6 +13,7 @@ RSpec.describe Bundler::Definition do subject { Bundler::Definition.new(nil, [], Bundler::SourceList.new, []) } it "raises an PermissionError with explanation" do + allow(File).to receive(:open).and_call_original expect(File).to receive(:open).with("Gemfile.lock", "wb"). and_raise(Errno::EACCES) expect { subject.lock("Gemfile.lock") }. @@ -23,6 +24,7 @@ RSpec.describe Bundler::Definition do subject { Bundler::Definition.new(nil, [], Bundler::SourceList.new, []) } it "raises a TemporaryResourceError with explanation" do + allow(File).to receive(:open).and_call_original expect(File).to receive(:open).with("Gemfile.lock", "wb"). and_raise(Errno::EAGAIN) expect { subject.lock("Gemfile.lock") }. |