summaryrefslogtreecommitdiff
path: root/spec/bundler/definition_spec.rb
diff options
context:
space:
mode:
authorJames Wen <jrw2175@columbia.edu>2015-12-28 00:14:32 -0500
committerJames Wen <jrw2175@columbia.edu>2015-12-28 00:48:26 -0500
commitc87f9dd7dc5ef69506325d8c581198488a222d46 (patch)
tree308f96c424809cc985f07224d741528aed29da7c /spec/bundler/definition_spec.rb
parentba0bac9761408f98b9ca806bbfd52b1de414513d (diff)
downloadbundler-c87f9dd7dc5ef69506325d8c581198488a222d46.tar.gz
Create `TemporaryResourceError` that `SharedHelpers#filesystem_access` raises for `Errno::EAGAIN`
- Pull out `action` as an instance method of `PermissionError`
Diffstat (limited to 'spec/bundler/definition_spec.rb')
-rw-r--r--spec/bundler/definition_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/bundler/definition_spec.rb b/spec/bundler/definition_spec.rb
index 076f2c8632..8dc4bd28f0 100644
--- a/spec/bundler/definition_spec.rb
+++ b/spec/bundler/definition_spec.rb
@@ -19,5 +19,15 @@ describe Bundler::Definition do
to raise_error(Bundler::PermissionError, /Gemfile\.lock/)
end
end
+ context "when a temporary resource access issue occurs" do
+ subject { Bundler::Definition.new(nil, [], Bundler::SourceList.new, []) }
+
+ it "raises a TemporaryResourceError with explanation" do
+ expect(File).to receive(:open).with("Gemfile.lock", "wb").
+ and_raise(Errno::EAGAIN)
+ expect { subject.lock("Gemfile.lock") }.
+ to raise_error(Bundler::TemporaryResourceError, /temporarily unavailable/)
+ end
+ end
end
end