Skip to content

Commit

Permalink
Merge pull request #643 from mbj/remove/unused-doubled-methods
Browse files Browse the repository at this point in the history
Remove unused methods on test doubles
  • Loading branch information
Dan Kubb committed Sep 26, 2016
2 parents f7ab9d1 + f842691 commit 5f9cef9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 35 deletions.
18 changes: 2 additions & 16 deletions spec/unit/mutant/env_spec.rb
Expand Up @@ -14,13 +14,13 @@
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(
Expand All @@ -37,15 +37,6 @@
)
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
Expand All @@ -68,12 +59,7 @@
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)
Expand Down
5 changes: 0 additions & 5 deletions spec/unit/mutant/result/env_spec.rb
Expand Up @@ -10,16 +10,11 @@
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,
Expand Down
8 changes: 1 addition & 7 deletions spec/unit/mutant/result/mutation_spec.rb
Expand Up @@ -6,13 +6,7 @@
)
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(
Expand Down
8 changes: 3 additions & 5 deletions 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) }
Expand All @@ -21,10 +20,9 @@
let(:config) do
instance_double(
Mutant::Config,
integration: integration,
jobs: 1,
kernel: kernel,
reporter: reporter
jobs: 1,
kernel: kernel,
reporter: reporter
)
end

Expand Down
3 changes: 1 addition & 2 deletions spec/unit/mutant/subject_spec.rb
Expand Up @@ -26,8 +26,7 @@ def foo
let(:context) do
double(
'Context',
source_path: 'source_path',
source_line: 'source_line'
source_path: 'source_path'
)
end

Expand Down

0 comments on commit 5f9cef9

Please sign in to comment.