free_mutant/spec/unit/mutant/mutator/literal/array_spec.rb

31 lines
613 B
Ruby
Raw Normal View History

require 'spec_helper'
describe Mutant::Mutator::Literal, 'array' do
let(:source) { '[true, false]' }
let(:mutations) do
mutations = []
# Literal replaced with nil
mutations << [:nil]
# Mutation of each element in array
mutations << '[nil, false]'
mutations << '[false, false]'
mutations << '[true, nil]'
mutations << '[true, true]'
# Remove each element of array once
mutations << '[true]'
mutations << '[false]'
# Empty array
mutations << '[]'
# Extra element
mutations << '[true, false, nil]'
end
2012-08-01 08:58:24 -04:00
it_should_behave_like 'a mutator'
end