Module: Mutant::Minitest::Coverage

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

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
# File 'lib/mutant/minitest/coverage.rb', line 22

def cover(expression)
  @cover_expressions = Set.new unless defined?(@cover_expressions)

  @cover_expressions << expression
end

#resolve_cover_expressionsSet<String>

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:

  • (Set<String>)


33
34
35
36
37
# File 'lib/mutant/minitest/coverage.rb', line 33

def resolve_cover_expressions
  return @cover_expressions if defined?(@cover_expressions)

  try_superclass_cover_expressions
end