Class: Mutant::Integration::Minitest::TestCase

Inherits:
Object
  • Object
show all
Includes:
Adamantium
Defined in:
lib/mutant/integration/minitest.rb

Overview

Compose a runnable with test method

This looks actually like a missing object on minitest implementation.

Instance Method Summary collapse

Instance Method Details

#call(reporter) ⇒ Boolean

Run test case

Parameters:

  • reporter (Object)

Returns:

  • (Boolean)


45
46
47
48
49
50
51
52
53
# File 'lib/mutant/integration/minitest.rb', line 45

def call(reporter)
  # Minitest 6.0+ renamed run_one_method to run
  if ::Minitest::Runnable.respond_to?(:run_one_method)
    ::Minitest::Runnable.run_one_method(klass, test_method, reporter)
  else
    ::Minitest::Runnable.run(klass, test_method, reporter)
  end
  reporter.passed?
end

#expressions(parser) ⇒ Array<Expression>

Parse expressions

Parameters:

  • parser (ExpressionParser)

Returns:

  • (Array<Expression>)


60
61
62
63
64
# File 'lib/mutant/integration/minitest.rb', line 60

def expressions(parser)
  klass.resolve_cover_expressions.to_a.map do |value|
    parser.call(expand_constant(value)).from_right
  end
end

#identificationString

Identification string

Returns:

  • (String)


37
# File 'lib/mutant/integration/minitest.rb', line 37

def identification = IDENTIFICATION_FORMAT % [klass, test_method]