diff --git a/lib/rspec/core/runner.rb b/lib/rspec/core/runner.rb index c5adddb202..7597a4bb8c 100644 --- a/lib/rspec/core/runner.rb +++ b/lib/rspec/core/runner.rb @@ -182,7 +182,7 @@ def self.trap_interrupt # @private def self.handle_interrupt if RSpec.world.wants_to_quit - exit!(1) + exit(1) else RSpec.world.wants_to_quit = true $stderr.puts "\nRSpec is shutting down and will print the summary report... Interrupt again to force quit." diff --git a/spec/rspec/core/runner_spec.rb b/spec/rspec/core/runner_spec.rb index afd4b4ed14..841f81092b 100644 --- a/spec/rspec/core/runner_spec.rb +++ b/spec/rspec/core/runner_spec.rb @@ -93,7 +93,7 @@ module RSpec::Core end describe "interrupt handling" do - before { allow(Runner).to receive(:exit!) } + before { allow(Runner).to receive(:exit) } it 'prints a message the first time, then exits the second time' do expect { @@ -101,13 +101,13 @@ module RSpec::Core }.to output(/shutting down/).to_stderr_from_any_process & change { RSpec.world.wants_to_quit }.from(a_falsey_value).to(true) - expect(Runner).not_to have_received(:exit!) + expect(Runner).not_to have_received(:exit) expect { Runner.handle_interrupt }.not_to output.to_stderr_from_any_process - expect(Runner).to have_received(:exit!) + expect(Runner).to have_received(:exit) end end @@ -149,7 +149,7 @@ def interrupt context "with SIGINT twice" do it "exits immediately" do Runner.send(:trap_interrupt) - expect(Runner).to receive(:exit!).with(1) + expect(Runner).to receive(:exit).with(1) expect { interrupt }.to output(//).to_stderr interrupt end