Class: Uberspec::Parallel
Instance Attribute Summary
Attributes inherited from Base
#config, #matches, #notifier, #watchr
Instance Method Summary collapse
Methods inherited from Rspec
Methods inherited from Base
#all_paths, #all_test_files, #clear, #find_and_run_match, #initialize, #run, run_all, #run_all, #set_notifier, #start_watching, #system_with_notify, watch
Constructor Details
This class inherits a constructor from Uberspec::Base
Instance Method Details
#command ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/uberspec/parallel.rb', line 4 def command case matches.length when 1 'parallel_spec -n 1' when 2..4 'parallel_spec -n 2' else 'parallel_spec' end end |
#parse_results(result_string) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/uberspec/parallel.rb', line 15 def parse_results(result_string) results = result_string.split("\n") results = results[results.rindex("Results:")+1,results.length].compact.delete_if {|i| i !~ /\S/i } examples = 0 pending = 0 failed = 0 results.each do |line| if line =~ /\d+ example/ stats = line.split(',').map(&:to_i) examples += stats[0] failed += stats[1] pending += stats[2] if stats[2] end end time = results.last.match(/\d*\.\d*/)[0].to_f {:examples => examples, :pending => pending, :failed => failed, :time => time} end |