Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 2a6bff1

Browse files
authored
Merge pull request #2318 from rspec/myron/address-slowness
Fix issue causing our spec suite to run much slower.
2 parents 910eb7f + 21f2e91 commit 2a6bff1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/rspec/core/invocations_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ def run_invocation
131131
end
132132

133133
describe Invocations::PrintVersion do
134+
before do
135+
allow(subject).to receive(:require).and_call_original
136+
allow(subject).to receive(:require).with("rspec/rails/version").and_raise(LoadError)
137+
end
138+
134139
it "prints the major.minor version of RSpec as a whole" do
135140
stub_const("RSpec::Core::Version::STRING", "9.18.23")
136141
run_invocation
@@ -162,8 +167,6 @@ def run_invocation
162167
end
163168

164169
it "indicates a part is not installed if it cannot be loaded" do
165-
expect { require 'rspec/rails/version' }.to raise_error(LoadError)
166-
167170
run_invocation
168171

169172
expect(out.string).not_to include("rspec-rails")

0 commit comments

Comments
 (0)