From f842691ca707932ff32df94d1520a213abfdff0a Mon Sep 17 00:00:00 2001 From: John Backus Date: Sun, 25 Sep 2016 16:49:38 -0700 Subject: [PATCH] Remove unused methods on test doubles --- spec/unit/mutant/env_spec.rb | 18 ++---------------- spec/unit/mutant/result/env_spec.rb | 5 ----- spec/unit/mutant/result/mutation_spec.rb | 8 +------- spec/unit/mutant/runner_spec.rb | 8 +++----- spec/unit/mutant/subject_spec.rb | 3 +-- 5 files changed, 7 insertions(+), 35 deletions(-) diff --git a/spec/unit/mutant/env_spec.rb b/spec/unit/mutant/env_spec.rb index b400f116..a808d87e 100644 --- a/spec/unit/mutant/env_spec.rb +++ b/spec/unit/mutant/env_spec.rb @@ -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) diff --git a/spec/unit/mutant/result/env_spec.rb b/spec/unit/mutant/result/env_spec.rb index e6900408..22d9bd78 100644 --- a/spec/unit/mutant/result/env_spec.rb +++ b/spec/unit/mutant/result/env_spec.rb @@ -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, diff --git a/spec/unit/mutant/result/mutation_spec.rb b/spec/unit/mutant/result/mutation_spec.rb index bca9dd18..baef27d1 100644 --- a/spec/unit/mutant/result/mutation_spec.rb +++ b/spec/unit/mutant/result/mutation_spec.rb @@ -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( diff --git a/spec/unit/mutant/runner_spec.rb b/spec/unit/mutant/runner_spec.rb index 8085dc93..5ac9a49b 100644 --- a/spec/unit/mutant/runner_spec.rb +++ b/spec/unit/mutant/runner_spec.rb @@ -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 diff --git a/spec/unit/mutant/subject_spec.rb b/spec/unit/mutant/subject_spec.rb index c24aca36..92e85342 100644 --- a/spec/unit/mutant/subject_spec.rb +++ b/spec/unit/mutant/subject_spec.rb @@ -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