Class: TestQueue::Runner::RSpec
- Inherits:
-
TestQueue::Runner
- Object
- TestQueue::Runner
- TestQueue::Runner::RSpec
- Defined in:
- lib/test_queue/runner/rspec.rb
Instance Attribute Summary
Attributes inherited from TestQueue::Runner
Instance Method Summary collapse
-
#initialize ⇒ RSpec
constructor
A new instance of RSpec.
- #run_worker(iterator) ⇒ Object
- #summarize_worker(worker) ⇒ Object
Methods inherited from TestQueue::Runner
#after_fork, #cleanup_worker, #distribute_queue, #execute, #execute_parallel, #execute_sequential, #spawn_workers, #start_master, #stats, #stop_master
Constructor Details
#initialize ⇒ RSpec
Returns a new instance of RSpec.
43 44 45 46 |
# File 'lib/test_queue/runner/rspec.rb', line 43 def initialize @rspec = ::RSpec::Core::QueueRunner.new super(@rspec.example_groups.sort_by{ |s| -(stats[s.description] || 0) }) end |
Instance Method Details
#run_worker(iterator) ⇒ Object
48 49 50 |
# File 'lib/test_queue/runner/rspec.rb', line 48 def run_worker(iterator) @rspec.run_each(iterator) end |
#summarize_worker(worker) ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/test_queue/runner/rspec.rb', line 52 def summarize_worker(worker) worker.stats.each do |s, val| stats[s.description] = val end num_tests = worker.lines.grep(/ examples?, /).first failures = worker.output[/^Failures:\n\n(.*)\n^Finished/m, 1] [ num_tests, failures ] end |