Skip to content

Commit

Permalink
Do not abort a child run when start another run
Browse files Browse the repository at this point in the history
  • Loading branch information
phuongnd08 committed Feb 18, 2012
1 parent 6546a50 commit 8308b6a
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions lib/spork/run_strategy/forking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,24 @@ def self.available?
end

def run(argv, stderr, stdout)
abort if running?

Spork.increase_process_counter

@child = ::Spork::Forker.new do
child = ::Spork::Forker.new do
$stdout, $stderr = stdout, stderr
load test_framework.helper_file
Spork.exec_each_run
result = test_framework.run_tests(argv, stderr, stdout)
Spork.exec_after_each_run
result
end
@child.result
end

def abort
@child && @child.abort
child.result
end

def preload
test_framework.preload
end

def running?
@child && @child.running?
end

def assert_ready!
raise RuntimeError, "This process hasn't loaded the environment yet by loading the prefork block" unless Spork.using_spork?
end
end
end

0 comments on commit 8308b6a

Please sign in to comment.