Module: Mutineer::TestRunners

Defined in:
lib/mutineer/test_runners.rb,
lib/mutineer/test_runners/rspec.rb,
lib/mutineer/test_runners/minitest.rb,
lib/mutineer/test_runners/rspec_seed.rb

Overview

Picks the test-framework runner.

Each runner responds to .run(files, stop_at_first_failure: false, record_to: nil) -> 0/1/2 (0 = all passed, 1 = any failure, 2 = no verdict: an error outside tests, which the RSpec runner reports, or a run whose first failure was an Active Record connection or lock error, on Minitest and on RSpec, #296, #347) and is called only inside a forked child. Only the mutant path passes stop_at_first_failure: true; a --matrix mutant run passes record_to: instead (a KillChannel pipe) and runs every test. The fork boundary silences stdout (see ChildStdout); the runners do not.

Defined Under Namespace

Modules: Minitest, RSpec, RSpecSeed

Class Method Summary collapse

Class Method Details

.for(framework) ⇒ Module

Returns the runner module for a framework name.

Parameters:

  • framework (String, nil) —

    framework name or nil.

Returns:

  • (Module) —

    Mutineer::TestRunners::Minitest or ::RSpec.

Raises:



25
26
27
28
29
30
31
32
# File 'lib/mutineer/test_runners.rb', line 25

def self.for(framework)
  case framework
  when "rspec" then RSpec
  when "minitest", nil, "" then Minitest
  else
    raise Mutineer::ConfigError, "unknown framework #{framework.inspect} (expected: minitest, rspec)"
  end
end