class ParallelTests::RSpec::Runner
Constants
- DEV_NULL
- NAME
Public Class Methods
command_with_seed(cmd, seed)
click to toggle source
remove old seed and add new seed –seed 1234 –order rand –order rand:1234 –order random:1234
# File lib/parallel_tests/rspec/runner.rb, line 48 def command_with_seed(cmd, seed) clean = cmd.sub(/\s--(seed\s+\d+|order\s+rand(om)?(:\d+)?)\b/, '') "#{clean} --seed #{seed}" end
determine_executable()
click to toggle source
# File lib/parallel_tests/rspec/runner.rb, line 16 def determine_executable case when File.exist?("bin/rspec") ParallelTests.with_ruby_binary("bin/rspec") when ParallelTests.bundler_enabled? "bundle exec rspec" else "rspec" end end
line_is_result?(line)
click to toggle source
# File lib/parallel_tests/rspec/runner.rb, line 39 def line_is_result?(line) line =~ /\d+ examples?, \d+ failures?/ end
run_tests(test_files, process_number, num_processes, options)
click to toggle source
# File lib/parallel_tests/rspec/runner.rb, line 10 def run_tests(test_files, process_number, num_processes, options) exe = executable # expensive, so we cache cmd = [exe, options[:test_options], color, spec_opts, *test_files].compact.join(" ") execute_command(cmd, process_number, num_processes, options) end
runtime_log()
click to toggle source
# File lib/parallel_tests/rspec/runner.rb, line 27 def runtime_log 'tmp/parallel_runtime_rspec.log' end
test_file_name()
click to toggle source
# File lib/parallel_tests/rspec/runner.rb, line 31 def test_file_name "spec" end
test_suffix()
click to toggle source
# File lib/parallel_tests/rspec/runner.rb, line 35 def test_suffix /_spec\.rb$/ end
Private Class Methods
color()
click to toggle source
# File lib/parallel_tests/rspec/runner.rb, line 61 def color '--color --tty' if $stdout.tty? end
run(cmd)
click to toggle source
so it can be stubbed.…
# File lib/parallel_tests/rspec/runner.rb, line 57 def run(cmd) `#{cmd}` end
spec_opts()
click to toggle source
# File lib/parallel_tests/rspec/runner.rb, line 65 def spec_opts options_file = ['.rspec_parallel', 'spec/parallel_spec.opts', 'spec/spec.opts'].detect{|f| File.file?(f) } return unless options_file "-O #{options_file}" end