2013-09-13 19:27:00 -04:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2013-09-13 19:01:11 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Mutant::Mutation do
|
|
|
|
|
|
|
|
let(:class_under_test) { Class.new(described_class) }
|
|
|
|
let(:object) { class_under_test.new(mutation_subject, Mutant::NodeHelpers::N_NIL) }
|
2013-09-13 19:17:14 -04:00
|
|
|
let(:mutation_subject) { double('Subject', identification: 'subject', source: 'original') }
|
2013-09-13 19:01:11 -04:00
|
|
|
let(:node) { double('Node') }
|
|
|
|
|
|
|
|
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 }
|
|
|
|
|
|
|
|
it { should eql('subject:8771a') }
|
|
|
|
|
|
|
|
it_should_behave_like 'an idempotent method'
|
|
|
|
end
|
|
|
|
end
|