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:
parent
10357b153e
commit
4a6954d53c
4 changed files with 10 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue