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:

Returns:



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:

Returns:



70
71
72
73
74
# File 'lib/mutant/integration/minitest.rb', line 70

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:



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

def identification = IDENTIFICATION_FORMAT % [klass, test_method]

#locationString?

Where the test method is defined

Returns:



58
59
60
61
62
# File 'lib/mutant/integration/minitest.rb', line 58

def location
  path, line = klass.instance_method(test_method).source_location

  "#{path}:#{line}" if path
end