Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more at_exit hax to play nice w/ rcov

  • Loading branch information...
commit dc290d32f7004778d53b0496faf3dd46860445ee 1 parent 03a5ca5
@dchelimsky dchelimsky authored
Showing with 3 additions and 6 deletions.
  1. +2 −5 lib/rspec/core/runner.rb
  2. +1 −1  spec/rspec/core/runner_spec.rb
View
7 lib/rspec/core/runner.rb
@@ -8,12 +8,9 @@ class Runner
def self.autorun
return if autorun_disabled? || installed_at_exit? || running_in_drb?
@installed_at_exit = true
- # The order here is important, the at_exit handler must be installed before anyone else gets a chance
- # to install their own, that way we can be assured that our exit will be last to run (at_exit stacks).
- # see https://github.com/jnicklas/capybara/issues/178
exit_code = nil
- at_exit { exit exit_code if exit_code && exit_code != 0 }
- exit_code = run(ARGV, $stderr, $stdout).to_i
+ at_exit { exit exit_code }
+ at_exit { exit_code = run(ARGV, $stderr, $stdout).to_i }
end
AT_EXIT_HOOK_BACKTRACE_LINE = "#{__FILE__}:#{__LINE__ - 2}:in `autorun'"
View
2  spec/rspec/core/runner_spec.rb
@@ -8,7 +8,7 @@ module RSpec::Core
RSpec::Core::Runner.stub(:running_in_drb?).and_return(false)
RSpec::Core::Runner.stub(:at_exit_hook_disabled?).and_return(false)
RSpec::Core::Runner.stub(:run).and_return(-1)
- RSpec::Core::Runner.should_receive(:at_exit)
+ RSpec::Core::Runner.should_receive(:at_exit).twice
RSpec::Core::Runner.autorun
end
Please sign in to comment.
Something went wrong with that request. Please try again.