diff --git a/lib/rspec_queue/worker_runner.rb b/lib/rspec_queue/worker_runner.rb index ae3e4bc..3cdb45a 100644 --- a/lib/rspec_queue/worker_runner.rb +++ b/lib/rspec_queue/worker_runner.rb @@ -14,16 +14,18 @@ def run_specs(example_groups) worker = RSpecQueue::Worker.new - reporter = @configuration.reporter + @configuration.with_suite_hooks do + reporter = @configuration.reporter - while(worker.has_work?) - # can we pass in a custom reporter which instantly reports back - # to the server? - example_group_hash[worker.current_example].run(reporter) - end + while(worker.has_work?) + # can we pass in a custom reporter which instantly reports back + # to the server? + example_group_hash[worker.current_example].run(reporter) + end - # report the results of the examples run to the master process - worker.finish(reporter) + # report the results of the examples run to the master process + worker.finish(reporter) + end ensure Process.exit