free_mutant/lib/mutant/config.rb
Markus Schirp 49133680ee Add AST caching for subject matcher
At least this dramatically speeds up unit tests. And this is a good
thing.
2013-06-27 22:18:07 +02:00

27 lines
522 B
Ruby

module Mutant
# The configuration of a mutator run
class Config
include Adamantium::Flat, Anima.new(
:cache, :debug, :strategy, :matcher, :filter, :reporter
)
# Enumerate subjects
#
# @api private
#
# @return [self]
# if block given
#
# @return [Enumerator<Subject>]
# otherwise
#
# @api private
#
def subjects(&block)
return to_enum(__method__) unless block_given?
matcher.each(&block)
self
end
end # Config
end # Mutant