Class: ParallelSpecs::RSpec::Runner
- Inherits:
-
Test::Runner
- Object
- Test::Runner
- ParallelSpecs::RSpec::Runner
- Defined in:
- lib/parallel_specs/rspec/runner.rb
Class Method Summary collapse
- .command_with_seed(command, seed) ⇒ Object
- .default_test_folder ⇒ Object
- .line_is_result?(line) ⇒ Boolean
- .rerun_command(command, seed: nil) ⇒ Object
- .run_tests(test_files, process_number, num_processes, options) ⇒ Object
- .runtime_log ⇒ Object
- .summarize_results(results) ⇒ Object
- .test_file_name ⇒ Object
Class Method Details
.command_with_seed(command, seed) ⇒ Object
54 55 56 |
# File 'lib/parallel_specs/rspec/runner.rb', line 54 def command_with_seed(command, seed) [*remove_command_arguments(command, "--seed", "--order"), "--seed", seed] end |
.default_test_folder ⇒ Object
22 23 24 |
# File 'lib/parallel_specs/rspec/runner.rb', line 22 def default_test_folder "spec" end |
.line_is_result?(line) ⇒ Boolean
30 31 32 |
# File 'lib/parallel_specs/rspec/runner.rb', line 30 def line_is_result?(line) line =~ /\d+ examples?, \d+ failures?/ end |
.rerun_command(command, seed: nil) ⇒ Object
49 50 51 52 |
# File 'lib/parallel_specs/rspec/runner.rb', line 49 def rerun_command(command, seed: nil) command = remove_rerun_only_formatters(command) seed ? command_with_seed(command, seed) : command end |
.run_tests(test_files, process_number, num_processes, options) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/parallel_specs/rspec/runner.rb', line 9 def run_tests(test_files, process_number, num_processes, ) execute_command( build_test_command(test_files, process_number, ), process_number, num_processes, ) end |
.runtime_log ⇒ Object
18 19 20 |
# File 'lib/parallel_specs/rspec/runner.rb', line 18 def runtime_log "tmp/parallel_runtime_rspec.log" end |
.summarize_results(results) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/parallel_specs/rspec/runner.rb', line 34 def summarize_results(results) text = super return text unless $stdout.tty? sums = send(:sum_up_results, results) color_code = if sums["failure"] > 0 31 elsif sums["pending"] > 0 33 else 32 end "\e[#{color_code}m#{text}\e[0m" end |
.test_file_name ⇒ Object
26 27 28 |
# File 'lib/parallel_specs/rspec/runner.rb', line 26 def test_file_name "spec" end |