Remove unused methods on test doubles

This commit is contained in:
John Backus 2016-09-25 16:49:38 -07:00
parent f7ab9d17e4
commit f842691ca7
No known key found for this signature in database
GPG key ID: 9A91898D0B0B2FBE
5 changed files with 7 additions and 35 deletions

View file

@ -14,13 +14,13 @@ RSpec.describe Mutant::Env do
end
let(:integration) { instance_double(Mutant::Integration) }
let(:context) { instance_double(Mutant::Context) }
let(:test_a) { instance_double(Mutant::Test) }
let(:test_b) { instance_double(Mutant::Test) }
let(:tests) { [test_a, test_b] }
let(:selector) { instance_double(Mutant::Selector) }
let(:integration_class) { Mutant::Integration::Null }
let(:isolation) { instance_double(Mutant::Isolation::Fork) }
let(:mutation_subject) { instance_double(Mutant::Subject) }
let(:mutation) do
instance_double(
@ -37,15 +37,6 @@ RSpec.describe Mutant::Env do
)
end
let(:mutation_subject) do
instance_double(
Mutant::Subject,
context: context,
identification: 'subject',
source: 'original'
)
end
subject { object.kill(mutation) }
shared_examples_for 'mutation kill' do
@ -68,12 +59,7 @@ RSpec.describe Mutant::Env do
end
context 'when isolation does not raise error' do
let(:test_result) do
instance_double(
Mutant::Result::Test,
passed: false
)
end
let(:test_result) { instance_double(Mutant::Result::Test) }
before do
expect(isolation).to receive(:call)

View file

@ -10,16 +10,11 @@ RSpec.describe Mutant::Result::Env do
let(:env) do
instance_double(
Mutant::Env,
config: config,
subjects: [instance_double(Mutant::Subject)],
mutations: [instance_double(Mutant::Mutation)]
)
end
let(:config) do
instance_double(Mutant::Config)
end
let(:subject_result) do
instance_double(
Mutant::Result::Subject,

View file

@ -6,13 +6,7 @@ RSpec.describe Mutant::Result::Mutation do
)
end
let(:mutation) do
instance_double(
Mutant::Mutation,
frozen?: true,
class: class_double(Mutant::Mutation)
)
end
let(:mutation) { instance_double(Mutant::Mutation) }
let(:test_result) do
instance_double(

View file

@ -1,6 +1,5 @@
RSpec.describe Mutant::Runner do
describe '.call' do
let(:integration) { instance_double(Mutant::Integration) }
let(:reporter) { instance_double(Mutant::Reporter, delay: delay) }
let(:driver) { instance_double(Mutant::Parallel::Driver) }
let(:delay) { instance_double(Float) }
@ -21,10 +20,9 @@ RSpec.describe Mutant::Runner do
let(:config) do
instance_double(
Mutant::Config,
integration: integration,
jobs: 1,
kernel: kernel,
reporter: reporter
jobs: 1,
kernel: kernel,
reporter: reporter
)
end

View file

@ -26,8 +26,7 @@ RSpec.describe Mutant::Subject do
let(:context) do
double(
'Context',
source_path: 'source_path',
source_line: 'source_line'
source_path: 'source_path'
)
end