
* The old layout was imposed by older mutants that selected tests via file names. * Reduce the useless namespace Mutator::Node::Connective
32 lines
666 B
Ruby
32 lines
666 B
Ruby
# encoding: utf-8
|
|
|
|
require 'spec_helper'
|
|
|
|
describe Mutant::Mutator, 'begin' do
|
|
|
|
# This mutation and only this mutation can result in
|
|
# and empty emit that is parsed into nil, unparser cannot
|
|
# handle this so we guard this here!
|
|
def generate(node)
|
|
return '' if node.nil?
|
|
super
|
|
end
|
|
|
|
let(:source) { "true\nfalse" }
|
|
|
|
let(:mutations) do
|
|
mutations = []
|
|
|
|
# Mutation of each statement in block
|
|
mutations << "true\ntrue"
|
|
mutations << "false\nfalse"
|
|
mutations << "nil\nfalse"
|
|
mutations << "true\nnil"
|
|
|
|
# Remove statement in block
|
|
mutations << 'true'
|
|
mutations << 'false'
|
|
end
|
|
|
|
it_should_behave_like 'a mutator'
|
|
end
|