Module: Mutant::Minitest::Coverage Private

Defined in:
lib/mutant/minitest/coverage.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#cover(expression) ⇒ Object

Setup coverage declaration for current class

Examples:


class MyTest < MiniTest::Test
  cover 'MyCode*'

  def test_some_stuff
  end
end

Parameters:

  • (String)


22
23
24
25
26
27
28
# File 'lib/mutant/minitest/coverage.rb', line 22

def cover(expression)
  if defined?(@cover_expression)
    fail "#{self} already declares to cover: #{@cover_expression.inspect}"
  end

  @cover_expression = expression
end

#resolve_cover_expressionString?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Effective coverage expression

Returns:

  • (String, nil)


35
36
37
38
39
# File 'lib/mutant/minitest/coverage.rb', line 35

def resolve_cover_expression
  return @cover_expression if defined?(@cover_expression)

  try_superclass_cover_expression
end