[rubygems/rubygems] Move `subject` to top level context

https://github.com/rubygems/rubygems/commit/331c415af0
This commit is contained in:
David Rodriguez 2024-01-26 09:11:47 +01:00 коммит произвёл Hiroshi SHIBATA
Родитель 24d5e7176e
Коммит e04120772b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F9CF13417264FAC2
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -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 }