Rename emit_elements to emit_body

* Reads a littebit better
* Nameing of methods in abstract Mutator base is still a mess
This commit is contained in:
Markus Schirp 2012-12-06 20:14:01 +01:00
parent 10357b153e
commit 4a6954d53c
4 changed files with 10 additions and 10 deletions

View file

@ -247,20 +247,20 @@ module Mutant
end
end
# Emit element mutations
# Emit body mutations
#
# @param [Array] elements
# @param [Array] body
#
# @return [undefined]
#
# @api private
#
def emit_elements(elements)
elements.each_with_index do |element, index|
dup_elements = elements.dup
def emit_body(body)
body.each_with_index do |element, index|
dup_body = body.dup
Mutator.each(element).each do |mutation|
dup_elements[index]=mutation
emit_self(dup_elements)
dup_body[index]=mutation
emit_self(dup_body)
end
end
end

View file

@ -15,7 +15,7 @@ module Mutant
#
def dispatch
array = node.array
emit_elements(array)
emit_body(array)
if array.length > 1
emit_element_presence(array)
else

View file

@ -20,7 +20,7 @@ module Mutant
emit_self([])
emit_self(body.dup << new_nil)
emit_element_presence(body)
emit_elements(body)
emit_body(body)
end
end
end

View file

@ -18,7 +18,7 @@ module Mutant
emit_nil
emit_values(values)
emit_element_presence
emit_elements(array)
emit_body(array)
end
# Return array of values in literal