Module: Mutineer::TestRunners

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

Overview

Picks the test-framework runner.

Each runner responds to .run(files) -> 0/1 (0 = all passed, 1 = any failure) and is called only inside a forked child.

Defined Under Namespace

Modules: Minitest, RSpec

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:



17
18
19
20
21
22
23
24
# File 'lib/mutineer/test_runners.rb', line 17

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