extract method
This commit is contained in:
parent
628ec101c7
commit
1f0de36e41
|
@ -236,16 +236,7 @@ class Autospec::Runner
|
||||||
last_failed = false
|
last_failed = false
|
||||||
current = @queue.last
|
current = @queue.last
|
||||||
if current
|
if current
|
||||||
result = run_spec(current[1])
|
last_failed = process_spec(current[1])
|
||||||
if result == 0
|
|
||||||
@queue.pop
|
|
||||||
else
|
|
||||||
last_failed = true
|
|
||||||
if result.to_i > 0
|
|
||||||
focus_on_failed_tests
|
|
||||||
ensure_all_specs_will_run
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
wait = @queue.length == 0 || last_failed
|
wait = @queue.length == 0 || last_failed
|
||||||
@signal.wait(@mutex) if wait
|
@signal.wait(@mutex) if wait
|
||||||
|
@ -256,6 +247,21 @@ class Autospec::Runner
|
||||||
puts e.backtrace
|
puts e.backtrace
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def process_spec(spec)
|
||||||
|
last_failed = false
|
||||||
|
if run_spec(spec) == 0
|
||||||
|
@queue.pop
|
||||||
|
else
|
||||||
|
last_failed = true
|
||||||
|
if result.to_i > 0
|
||||||
|
focus_on_failed_tests
|
||||||
|
ensure_all_specs_will_run
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
last_failed
|
||||||
|
end
|
||||||
|
|
||||||
def start_service_queue
|
def start_service_queue
|
||||||
@worker ||= Thread.new do
|
@worker ||= Thread.new do
|
||||||
while true
|
while true
|
||||||
|
|
Loading…
Reference in New Issue