free_mutant/lib/mutant/meta/example.rb
John Backus 523bad401e
Refactor to add Mutant::Mutator.mutate(...)
Refactors Registry to be more generic
2016-05-07 15:03:45 -07:00

33 lines
714 B
Ruby

module Mutant
module Meta
class Example
include Adamantium, Anima.new(:file, :node, :node_type, :expected)
# Verification instance for example
#
# @return [Verification]
def verification
Verification.new(self, generated)
end
# Normalized source
#
# @return [String]
def source
Unparser.unparse(node)
end
memoize :source
# Generated mutations on example source
#
# @return [Enumerable<Mutant::Mutation>]
def generated
Mutator.mutate(node).map do |node|
Mutation::Evil.new(self, node)
end
end
memoize :generated
end # Example
end # Meta
end # Mutant