summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodriguez <deivid.rodriguez@riseup.net>2024-01-26 09:11:47 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-02-08 14:43:56 +0900
commite04120772be6162499023f7245434cb5c9175344 (patch)
treed6db285e99a1ad145195c11d05978e79aba372ce
parent24d5e7176e80cecfc38daf80020fb85f1144083b (diff)
[rubygems/rubygems] Move `subject` to top level context
https://github.com/rubygems/rubygems/commit/331c415af0
-rw-r--r--spec/bundler/bundler/definition_spec.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/bundler/bundler/definition_spec.rb b/spec/bundler/bundler/definition_spec.rb
index 85f13d287c..5e66e012c0 100644
--- a/spec/bundler/bundler/definition_spec.rb
+++ b/spec/bundler/bundler/definition_spec.rb
@@ -9,9 +9,10 @@ RSpec.describe Bundler::Definition do
allow(Bundler::SharedHelpers).to receive(:find_gemfile) { Pathname.new("Gemfile") }
allow(Bundler).to receive(:ui) { double("UI", info: "", debug: "") }
end
- context "when it's not possible to write to the file" do
- subject { Bundler::Definition.new("Gemfile.lock", [], Bundler::SourceList.new, []) }
+ subject { Bundler::Definition.new("Gemfile.lock", [], Bundler::SourceList.new, []) }
+
+ context "when it's not possible to write to the file" do
it "raises an PermissionError with explanation" do
allow(File).to receive(:open).and_call_original
expect(File).to receive(:open).with("Gemfile.lock", "wb").
@@ -21,8 +22,6 @@ RSpec.describe Bundler::Definition do
end
end
context "when a temporary resource access issue occurs" do
- subject { Bundler::Definition.new("Gemfile.lock", [], 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").
@@ -32,7 +31,6 @@ RSpec.describe Bundler::Definition do
end
end
context "when Bundler::Definition.no_lock is set to true" do
- subject { Bundler::Definition.new("Gemfile.lock", [], Bundler::SourceList.new, []) }
before { Bundler::Definition.no_lock = true }
after { Bundler::Definition.no_lock = false }