free_mutant/spec/unit/mutant/mutation_spec.rb
Markus Schirp 13cd04d9be Introduce AST::Meta to externalize semantic analysis
* Add Mutant::AST namespace to hold all AST related data / helpers.
* Mutant::AST will be externalized into an ast-meta gem that can be
  shared with unparser for deduplication.
* Over the time the mutators itself will not need to deal with semantic
  analysis of the AST anymore by themselves.
* Move AST analysis for send nodes to AST::Meta
* Fix #209
2014-06-29 21:26:58 +00:00

45 lines
1 KiB
Ruby

require 'spec_helper'
describe Mutant::Mutation do
class TestMutation < Mutant::Mutation
SYMBOL = 'test'.freeze
end
let(:object) { TestMutation.new(mutation_subject, Mutant::AST::Nodes::N_NIL) }
let(:mutation_subject) { double('Subject', identification: 'subject', source: 'original') }
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('test:subject:8771a') }
it_should_behave_like 'an idempotent method'
end
end