free_mutant/lib/mutant/matcher/config.rb
Markus Schirp 41d9700473 Refactor runer infrastructure
* Nuke around 800 lock
* Honor LSP with not anymore squeezing something non LSP compatible in
  the same inheritance tree.
* Separate running from result tree.
* Clean up kill logic and early exits on already dead mutations.
* Fix #runnin? smell for reporters.
* Decouple config object from VM state. Makes it serializable to enable
  config loading.
* Fix sequence of global VM events to match PRIOR rspec infects VM with
  gazillions of classes / modules. Thix fixes a startup speed
  degeneration.
* Various fixes to enhance determinism.
* Replace some unneded manual double dispatch with single manual dispatch for
  reporter / runners.
2014-07-05 23:04:38 +00:00

28 lines
631 B
Ruby

module Mutant
class Matcher
# Match configuration
class Config
include Adamantium, Anima::Update, Anima.new(
:match_expressions,
:subject_ignores,
:subject_selects
)
DEFAULT = new(Hash[anima.attribute_names.map { |name| [name, []] }])
# Return configuration with added value
#
# @param [Symbol] attribute
# @param [Object] value
#
# @return [Config]
#
# @api private
#
def add(attribute, value)
update(attribute => public_send(attribute).dup << value)
end
end # Config
end # Matcher
end # Mutant