Class: RSpec::Parallel::Runner
- Inherits:
-
Object
- Object
- RSpec::Parallel::Runner
- Defined in:
- lib/rspec/parallel/runner.rb
Instance Attribute Summary collapse
-
#pids ⇒ Array<Integer>
readonly
Array of pids of spawned worker processes.
Instance Method Summary collapse
-
#initialize(args) ⇒ Runner
constructor
A new instance of Runner.
- #start ⇒ void
Constructor Details
#initialize(args) ⇒ Runner
Returns a new instance of Runner.
13 14 15 16 17 18 19 20 21 |
# File 'lib/rspec/parallel/runner.rb', line 13 def initialize(args) @args = args @pids = [] # Configure RSpec core before initialize master instance and spawning # worker processes to share its configuration. configure_rspec @master = Master.new(args) end |
Instance Attribute Details
#pids ⇒ Array<Integer> (readonly)
Returns array of pids of spawned worker processes.
10 11 12 |
# File 'lib/rspec/parallel/runner.rb', line 10 def pids @pids end |
Instance Method Details
#start ⇒ void
This method returns an undefined value.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rspec/parallel/runner.rb', line 24 def start RSpec::Parallel.configuration.concurrency.times do spawn_worker end master.run Process.waitall ensure pids.each.with_index do |pid, index| puts "----> output from worker[#{index}]" File.open(output_file_path(pid)) do |file| puts file.read end end end |