class Mutest::Mutator::Node::Block

Emitter for mutations on 19 blocks

Private Instance Methods

dispatch() click to toggle source

Emit mutations

@return [undefined]

# File lib/mutest/mutator/node/block.rb, line 15
def dispatch
  emit_singletons
  emit(send) unless n_lambda?(send)
  emit_send_mutations(&method(:n_send?))
  emit_arguments_mutations

  mutate_body
end
mutate_body() click to toggle source

Emit body mutations

@return [undefined]

# File lib/mutest/mutator/node/block.rb, line 27
def mutate_body
  emit_body(nil)
  emit_body(N_RAISE)

  return unless body

  emit(body)
  emit_body_mutations

  mutate_body_receiver
end
mutate_body_receiver() click to toggle source

Mutate method send in body scope of `send`

@return [undefined]

# File lib/mutest/mutator/node/block.rb, line 42
def mutate_body_receiver
  return unless n_send?(body)

  body_meta = AST::Meta::Send.new(body)

  emit(s(:send, send, body_meta.selector, *body_meta.arguments))
end