Add specs for Mutant::Subject#indentification
This commit is contained in:
parent
2b620f4889
commit
7bbe86ff95
1 changed files with 39 additions and 0 deletions
39
spec/unit/mutant/subject_spec.rb
Normal file
39
spec/unit/mutant/subject_spec.rb
Normal file
|
@ -0,0 +1,39 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Mutant::Subject do
|
||||
let(:class_under_test) do
|
||||
Class.new(described_class) do
|
||||
def match_expression
|
||||
'match'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
let(:object) { class_under_test.new(context, node) }
|
||||
|
||||
let(:node) do
|
||||
double('Node', :location => location)
|
||||
end
|
||||
|
||||
let(:location) do
|
||||
double('Location', :expression => expression)
|
||||
end
|
||||
|
||||
let(:expression) do
|
||||
double('Expression', :line => 'source_line')
|
||||
end
|
||||
|
||||
let(:context) do
|
||||
double(
|
||||
'Context',
|
||||
:source_path => 'source_path',
|
||||
:source_line => 'source_line',
|
||||
)
|
||||
end
|
||||
|
||||
describe '#identification' do
|
||||
subject { object.identification }
|
||||
|
||||
it { should eql('match:source_path:source_line') }
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue