2014-08-10 17:04:05 -04:00
|
|
|
RSpec.describe Mutant::Mutation do
|
2013-09-13 19:01:11 -04:00
|
|
|
|
2014-05-11 10:38:07 -04:00
|
|
|
class TestMutation < Mutant::Mutation
|
2014-06-02 07:09:49 -04:00
|
|
|
SYMBOL = 'test'.freeze
|
2014-05-11 10:38:07 -04:00
|
|
|
end
|
|
|
|
|
2014-10-23 07:37:53 -04:00
|
|
|
let(:object) { TestMutation.new(mutation_subject, Mutant::AST::Nodes::N_NIL) }
|
|
|
|
let(:context) { double('Context') }
|
|
|
|
|
|
|
|
let(:mutation_subject) do
|
|
|
|
double(
|
|
|
|
'Subject',
|
|
|
|
identification: 'subject',
|
|
|
|
context: context,
|
|
|
|
source: 'original',
|
2014-11-27 11:34:08 -05:00
|
|
|
tests: tests
|
2014-10-23 07:37:53 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
let(:test_a) { double('Test A') }
|
|
|
|
let(:test_b) { double('Test B') }
|
2014-11-27 11:34:08 -05:00
|
|
|
let(:tests) { [test_a, test_b] }
|
2014-10-23 07:37:53 -04:00
|
|
|
|
2013-09-13 19:01:11 -04:00
|
|
|
describe '#code' do
|
|
|
|
subject { object.code }
|
|
|
|
|
|
|
|
it { should eql('8771a') }
|
|
|
|
|
|
|
|
it_should_behave_like 'an idempotent method'
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#original_source' do
|
|
|
|
subject { object.original_source }
|
|
|
|
|
|
|
|
it { should eql('original') }
|
|
|
|
|
|
|
|
it_should_behave_like 'an idempotent method'
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#source' do
|
|
|
|
subject { object.source }
|
|
|
|
|
|
|
|
it { should eql('nil') }
|
|
|
|
|
|
|
|
it_should_behave_like 'an idempotent method'
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#identification' do
|
|
|
|
|
|
|
|
subject { object.identification }
|
|
|
|
|
2014-05-11 10:38:07 -04:00
|
|
|
it { should eql('test:subject:8771a') }
|
2013-09-13 19:01:11 -04:00
|
|
|
|
|
|
|
it_should_behave_like 'an idempotent method'
|
|
|
|
end
|
|
|
|
end
|