class Mutest::Matcher::Compiler

Compiler for complex matchers

Public Instance Methods

result() click to toggle source

Generated matcher

@return [Matcher]

# File lib/mutest/matcher/compiler.rb, line 12
def result
  Filter.new(
    Chain.new(config.match_expressions.map(&:matcher)),
    Morpher::Evaluator::Predicate::Boolean::And.new(
      [
        ignored_subjects,
        filtered_subjects
      ]
    )
  )
end

Private Instance Methods

filtered_subjects() click to toggle source

Predicate returning false on filtered subject

@return [#call]

# File lib/mutest/matcher/compiler.rb, line 52
def filtered_subjects
  Morpher::Evaluator::Predicate::Boolean::And.new(config.subject_filters)
end
ignored_subjects() click to toggle source

Predicate returning false on expression ignored subject

@return [#call]

# File lib/mutest/matcher/compiler.rb, line 41
def ignored_subjects
  Morpher::Evaluator::Predicate::Boolean::Negation.new(
    Morpher::Evaluator::Predicate::Boolean::Or.new(
      config.ignore_expressions.map(&SubjectPrefix.method(:new))
    )
  )
end