2013-07-28 19:03:06 -04:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2013-07-24 01:58:53 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2013-12-29 17:04:28 -05:00
|
|
|
describe Mutant::Mutator::Node::Binary, 'mutations' do
|
2013-07-24 01:58:53 -04:00
|
|
|
context 'and' do
|
|
|
|
let(:source) { 'true and false' }
|
|
|
|
|
|
|
|
let(:mutations) do
|
|
|
|
mutations = []
|
|
|
|
mutations << 'nil'
|
|
|
|
mutations << 'true'
|
|
|
|
mutations << 'false'
|
|
|
|
|
|
|
|
mutations << 'true or false'
|
|
|
|
|
2013-07-24 02:41:05 -04:00
|
|
|
mutations << 'not true and false'
|
2013-07-25 11:43:41 -04:00
|
|
|
mutations << 'not(true and false)'
|
2013-07-24 01:58:53 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it_should_behave_like 'a mutator'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'or' do
|
|
|
|
let(:source) { 'true or false' }
|
|
|
|
|
|
|
|
let(:mutations) do
|
|
|
|
mutations = []
|
|
|
|
mutations << 'nil'
|
|
|
|
mutations << 'true'
|
|
|
|
mutations << 'false'
|
|
|
|
|
|
|
|
mutations << 'true and false'
|
|
|
|
|
2013-07-24 02:41:05 -04:00
|
|
|
mutations << 'not true or false'
|
2013-07-25 11:43:41 -04:00
|
|
|
mutations << 'not(true or false)'
|
2013-07-24 01:58:53 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it_should_behave_like 'a mutator'
|
|
|
|
end
|
|
|
|
end
|