Remove unused methods on test doubles
This commit is contained in:
parent
f7ab9d17e4
commit
f842691ca7
5 changed files with 7 additions and 35 deletions
|
@ -14,13 +14,13 @@ RSpec.describe Mutant::Env do
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:integration) { instance_double(Mutant::Integration) }
|
let(:integration) { instance_double(Mutant::Integration) }
|
||||||
let(:context) { instance_double(Mutant::Context) }
|
|
||||||
let(:test_a) { instance_double(Mutant::Test) }
|
let(:test_a) { instance_double(Mutant::Test) }
|
||||||
let(:test_b) { instance_double(Mutant::Test) }
|
let(:test_b) { instance_double(Mutant::Test) }
|
||||||
let(:tests) { [test_a, test_b] }
|
let(:tests) { [test_a, test_b] }
|
||||||
let(:selector) { instance_double(Mutant::Selector) }
|
let(:selector) { instance_double(Mutant::Selector) }
|
||||||
let(:integration_class) { Mutant::Integration::Null }
|
let(:integration_class) { Mutant::Integration::Null }
|
||||||
let(:isolation) { instance_double(Mutant::Isolation::Fork) }
|
let(:isolation) { instance_double(Mutant::Isolation::Fork) }
|
||||||
|
let(:mutation_subject) { instance_double(Mutant::Subject) }
|
||||||
|
|
||||||
let(:mutation) do
|
let(:mutation) do
|
||||||
instance_double(
|
instance_double(
|
||||||
|
@ -37,15 +37,6 @@ RSpec.describe Mutant::Env do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:mutation_subject) do
|
|
||||||
instance_double(
|
|
||||||
Mutant::Subject,
|
|
||||||
context: context,
|
|
||||||
identification: 'subject',
|
|
||||||
source: 'original'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
subject { object.kill(mutation) }
|
subject { object.kill(mutation) }
|
||||||
|
|
||||||
shared_examples_for 'mutation kill' do
|
shared_examples_for 'mutation kill' do
|
||||||
|
@ -68,12 +59,7 @@ RSpec.describe Mutant::Env do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when isolation does not raise error' do
|
context 'when isolation does not raise error' do
|
||||||
let(:test_result) do
|
let(:test_result) { instance_double(Mutant::Result::Test) }
|
||||||
instance_double(
|
|
||||||
Mutant::Result::Test,
|
|
||||||
passed: false
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
before do
|
before do
|
||||||
expect(isolation).to receive(:call)
|
expect(isolation).to receive(:call)
|
||||||
|
|
|
@ -10,16 +10,11 @@ RSpec.describe Mutant::Result::Env do
|
||||||
let(:env) do
|
let(:env) do
|
||||||
instance_double(
|
instance_double(
|
||||||
Mutant::Env,
|
Mutant::Env,
|
||||||
config: config,
|
|
||||||
subjects: [instance_double(Mutant::Subject)],
|
subjects: [instance_double(Mutant::Subject)],
|
||||||
mutations: [instance_double(Mutant::Mutation)]
|
mutations: [instance_double(Mutant::Mutation)]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:config) do
|
|
||||||
instance_double(Mutant::Config)
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:subject_result) do
|
let(:subject_result) do
|
||||||
instance_double(
|
instance_double(
|
||||||
Mutant::Result::Subject,
|
Mutant::Result::Subject,
|
||||||
|
|
|
@ -6,13 +6,7 @@ RSpec.describe Mutant::Result::Mutation do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:mutation) do
|
let(:mutation) { instance_double(Mutant::Mutation) }
|
||||||
instance_double(
|
|
||||||
Mutant::Mutation,
|
|
||||||
frozen?: true,
|
|
||||||
class: class_double(Mutant::Mutation)
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:test_result) do
|
let(:test_result) do
|
||||||
instance_double(
|
instance_double(
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
RSpec.describe Mutant::Runner do
|
RSpec.describe Mutant::Runner do
|
||||||
describe '.call' do
|
describe '.call' do
|
||||||
let(:integration) { instance_double(Mutant::Integration) }
|
|
||||||
let(:reporter) { instance_double(Mutant::Reporter, delay: delay) }
|
let(:reporter) { instance_double(Mutant::Reporter, delay: delay) }
|
||||||
let(:driver) { instance_double(Mutant::Parallel::Driver) }
|
let(:driver) { instance_double(Mutant::Parallel::Driver) }
|
||||||
let(:delay) { instance_double(Float) }
|
let(:delay) { instance_double(Float) }
|
||||||
|
@ -21,10 +20,9 @@ RSpec.describe Mutant::Runner do
|
||||||
let(:config) do
|
let(:config) do
|
||||||
instance_double(
|
instance_double(
|
||||||
Mutant::Config,
|
Mutant::Config,
|
||||||
integration: integration,
|
jobs: 1,
|
||||||
jobs: 1,
|
kernel: kernel,
|
||||||
kernel: kernel,
|
reporter: reporter
|
||||||
reporter: reporter
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,7 @@ RSpec.describe Mutant::Subject do
|
||||||
let(:context) do
|
let(:context) do
|
||||||
double(
|
double(
|
||||||
'Context',
|
'Context',
|
||||||
source_path: 'source_path',
|
source_path: 'source_path'
|
||||||
source_line: 'source_line'
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue