free_mutant/lib/mutant/mutator/node/pattern_arguments.rb
Markus Schirp fce6d5c06e Metric diven cleanups and break large classes
* Formal argument mutations are still very dirty :(
2012-12-29 20:12:48 +01:00

41 lines
821 B
Ruby

module Mutant
class Mutator
class Node
# Mutator for pattern arguments
class PatternArguments < self
handle(Rubinius::AST::PatternArguments)
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
Mutator.each(node.arguments.body) do |mutation|
dup = dup_node
dup.arguments.body = mutation
emit(dup)
end
end
# Test if mutation should be skipped
#
# @return [true]
# if mutation should be skipped
#
# @return [false]
# otherwise
#
# @api private
#
def allow?(object)
object.arguments.body.size >= 2
end
end
end
end
end