diff --git a/spec/support/shared_context.rb b/spec/support/shared_context.rb index ef540521..20c5772f 100644 --- a/spec/support/shared_context.rb +++ b/spec/support/shared_context.rb @@ -37,13 +37,8 @@ module SharedContext let(:env) { instance_double(Mutant::Env, config: config, subjects: [subject_a], mutations: mutations) } let(:job_a) { Mutant::Parallel::Job.new(index: 0, payload: mutation_a) } let(:job_b) { Mutant::Parallel::Job.new(index: 1, payload: mutation_b) } - let(:job_a_result) { Mutant::Runner::JobResult.new(job: job_a, result: mutation_a_result) } - let(:job_b_result) { Mutant::Runner::JobResult.new(job: job_b, result: mutation_b_result) } let(:test_a) { instance_double(Mutant::Test, identification: 'test-a') } - let(:test_b) { instance_double(Mutant::Test, identification: 'test-b') } let(:output) { StringIO.new } - let(:matchable_scopes) { instance_double(Array, length: 10) } - let(:message_sequence) { FakeActor::MessageSequence.new } let(:mutations) { [mutation_a, mutation_b] } let(:mutation_a_node) { s(:false) } let(:mutation_b_node) { s(:nil) } @@ -126,13 +121,5 @@ module SharedContext mutation_results: [mutation_a_result, mutation_b_result] ) end - - let(:empty_subject_a_result) do - subject_a_result.with(mutation_results: []) - end - - let(:partial_subject_a_result) do - subject_a_result.with(mutation_results: [mutation_a_result]) - end end end # SharedContext diff --git a/spec/unit/mutant/actor/mailbox_spec.rb b/spec/unit/mutant/actor/mailbox_spec.rb index bfdba82a..9f4c864e 100644 --- a/spec/unit/mutant/actor/mailbox_spec.rb +++ b/spec/unit/mutant/actor/mailbox_spec.rb @@ -10,9 +10,6 @@ RSpec.describe Mutant::Actor::Mailbox do describe '.new' do subject { described_class.new } - let(:object) { described_class.new } - let(:thread) { instance_double(Thread) } - its(:sender) { should eql(Mutant::Actor::Sender.new(condition_variable, mutex, [])) } its(:receiver) { should eql(Mutant::Actor::Receiver.new(condition_variable, mutex, [])) } diff --git a/spec/unit/mutant/cli_spec.rb b/spec/unit/mutant/cli_spec.rb index e4350e94..f85b5b9a 100644 --- a/spec/unit/mutant/cli_spec.rb +++ b/spec/unit/mutant/cli_spec.rb @@ -66,7 +66,6 @@ RSpec.describe Mutant::CLI do subject { object.new(arguments) } # Defaults - let(:expected_filter) { Morpher.evaluator(s(:true)) } let(:expected_integration) { Mutant::Integration::Null } let(:expected_reporter) { Mutant::Config::DEFAULT.reporter } let(:expected_matcher_config) { default_matcher_config } diff --git a/spec/unit/mutant/context_spec.rb b/spec/unit/mutant/context_spec.rb index ef0e7301..636bfd27 100644 --- a/spec/unit/mutant/context_spec.rb +++ b/spec/unit/mutant/context_spec.rb @@ -31,7 +31,6 @@ RSpec.describe Mutant::Context do end let(:object) { described_class.new(scope, source_path) } - let(:scope_name) { instance_double(String) } let(:source_path) { instance_double(Pathname) } let(:scope) { TestApp::Literal } @@ -60,10 +59,6 @@ RSpec.describe Mutant::Context do Unparser.unparse(subject) end - let(:round_tripped_source) do - Unparser.unparse(parse(expected_source)) - end - it 'should create correct source' do expect(generated_source).to eql(expected_source) end @@ -72,8 +67,6 @@ RSpec.describe Mutant::Context do describe '#unqualified_name' do subject { object.unqualified_name } - let(:path) { instance_double(Pathname) } - context 'with top level constant name' do let(:scope) { TestApp } diff --git a/spec/unit/mutant/env_spec.rb b/spec/unit/mutant/env_spec.rb index 6cda4220..b400f116 100644 --- a/spec/unit/mutant/env_spec.rb +++ b/spec/unit/mutant/env_spec.rb @@ -14,7 +14,6 @@ RSpec.describe Mutant::Env do end let(:integration) { instance_double(Mutant::Integration) } - let(:wrapped_node) { instance_double(Parser::AST::Node) } let(:context) { instance_double(Mutant::Context) } let(:test_a) { instance_double(Mutant::Test) } let(:test_b) { instance_double(Mutant::Test) } diff --git a/spec/unit/mutant/expression_spec.rb b/spec/unit/mutant/expression_spec.rb index 655ead73..7bd9bebf 100644 --- a/spec/unit/mutant/expression_spec.rb +++ b/spec/unit/mutant/expression_spec.rb @@ -1,6 +1,4 @@ RSpec.describe Mutant::Expression do - let(:object) { described_class } - let(:parser) { Mutant::Config::DEFAULT.expression_parser } describe '#prefix?' do diff --git a/spec/unit/mutant/matcher/compiler_spec.rb b/spec/unit/mutant/matcher/compiler_spec.rb index 982e0642..cf0d1176 100644 --- a/spec/unit/mutant/matcher/compiler_spec.rb +++ b/spec/unit/mutant/matcher/compiler_spec.rb @@ -1,11 +1,9 @@ RSpec.describe Mutant::Matcher::Compiler, '#call' do let(:object) { described_class } - let(:env) { Fixtures::TEST_ENV } let(:matcher_config) { Mutant::Matcher::Config::DEFAULT } let(:expression_a) { parse_expression('Foo*') } let(:expression_b) { parse_expression('Bar*') } let(:matcher_a) { expression_a.matcher } - let(:matcher_b) { expression_b.matcher } let(:expected_matcher) do Mutant::Matcher::Filter.new( diff --git a/spec/unit/mutant/matcher/method/instance_spec.rb b/spec/unit/mutant/matcher/method/instance_spec.rb index ff1c2b07..9ae77128 100644 --- a/spec/unit/mutant/matcher/method/instance_spec.rb +++ b/spec/unit/mutant/matcher/method/instance_spec.rb @@ -5,7 +5,6 @@ RSpec.describe Mutant::Matcher::Method::Instance, '#call' do let(:method_name) { :foo } let(:source_path) { MutantSpec::ROOT.join('test_app/lib/test_app.rb') } let(:method) { scope.instance_method(method_name) } - let(:namespace) { self.class } let(:type) { :def } let(:method_arity) { 0 } let(:base) { TestApp::InstanceMethodTests } @@ -29,7 +28,6 @@ RSpec.describe Mutant::Matcher::Method::Instance, '#call' do context 'when method is defined inside eval' do let(:scope) { base::WithMemoizer } let(:method) { scope.instance_method(:boz) } - let(:method_name) { :boz } let(:expected_warnings) do [ diff --git a/spec/unit/mutant/matcher/method/singleton_spec.rb b/spec/unit/mutant/matcher/method/singleton_spec.rb index 943cff34..b22861ad 100644 --- a/spec/unit/mutant/matcher/method/singleton_spec.rb +++ b/spec/unit/mutant/matcher/method/singleton_spec.rb @@ -26,8 +26,7 @@ RSpec.describe Mutant::Matcher::Method::Singleton, '#call' do end context 'when also defined on lvar' do - let(:scope) { base::DefinedOnLvar } - let(:method_line) { 66 } + let(:scope) { base::DefinedOnLvar } let(:expected_warnings) do [ 'Can only match :defs on :self or :const got :lvar unable to match' diff --git a/spec/unit/mutant/mutation_spec.rb b/spec/unit/mutant/mutation_spec.rb index 29257670..16f1e3b2 100644 --- a/spec/unit/mutant/mutation_spec.rb +++ b/spec/unit/mutant/mutation_spec.rb @@ -21,9 +21,6 @@ RSpec.describe Mutant::Mutation do ) end - let(:test_a) { instance_double(Mutant::Test) } - let(:test_b) { instance_double(Mutant::Test) } - describe '#insert' do subject { object.insert(kernel) } diff --git a/spec/unit/mutant/mutator_spec.rb b/spec/unit/mutant/mutator_spec.rb index c419a239..0ac5d59e 100644 --- a/spec/unit/mutant/mutator_spec.rb +++ b/spec/unit/mutant/mutator_spec.rb @@ -1,7 +1,5 @@ RSpec.describe Mutant::Mutator do describe '.handle' do - let(:object) { described_class } - subject do Class.new(described_class) do const_set(:REGISTRY, Mutant::Registry.new) diff --git a/spec/unit/mutant/parallel/master_spec.rb b/spec/unit/mutant/parallel/master_spec.rb index 47534dc0..278de25c 100644 --- a/spec/unit/mutant/parallel/master_spec.rb +++ b/spec/unit/mutant/parallel/master_spec.rb @@ -1,7 +1,6 @@ RSpec.describe Mutant::Parallel::Master do let(:message_sequence) { FakeActor::MessageSequence.new } let(:actor_names) { %i[master worker_a worker_b] } - let(:status) { instance_double(Mutant::Result::Status) } let(:sink) { FakeSink.new } let(:processor) { instance_double(Proc) } let(:worker_a) { actor_env.mailbox(:worker_a).sender } @@ -135,8 +134,6 @@ RSpec.describe Mutant::Parallel::Master do end context 'while jobs are processed' do - let(:expected_results) { [job_result_payload_a] } - let(:sink) do super().instance_eval do def stop? diff --git a/spec/unit/mutant/parallel/worker_spec.rb b/spec/unit/mutant/parallel/worker_spec.rb index 306a5665..89046762 100644 --- a/spec/unit/mutant/parallel/worker_spec.rb +++ b/spec/unit/mutant/parallel/worker_spec.rb @@ -39,7 +39,6 @@ RSpec.describe Mutant::Parallel::Worker do end let(:index) { instance_double(Fixnum) } - let(:test_result) { instance_double(Mutant::Result::Test) } let(:job_result) { Mutant::Parallel::JobResult.new(job: job, payload: result_payload) } let(:job) { Mutant::Parallel::Job.new(index: index, payload: payload) } diff --git a/spec/unit/mutant/registry_spec.rb b/spec/unit/mutant/registry_spec.rb index dc92109e..dbd28ba4 100644 --- a/spec/unit/mutant/registry_spec.rb +++ b/spec/unit/mutant/registry_spec.rb @@ -1,9 +1,7 @@ RSpec.describe Mutant::Registry do - let(:lookup) { object.lookup(type) } - let(:object) { described_class.new } - let(:mutator) { class_double(Mutant::Mutator) } - let(:node) { s(:true) } - let(:expected_arguments) { [node, nil] } + let(:lookup) { object.lookup(type) } + let(:object) { described_class.new } + let(:mutator) { class_double(Mutant::Mutator) } def register_mutator object.register(type, mutator) diff --git a/spec/unit/mutant/result/mutation_spec.rb b/spec/unit/mutant/result/mutation_spec.rb index 96179b7b..bca9dd18 100644 --- a/spec/unit/mutant/result/mutation_spec.rb +++ b/spec/unit/mutant/result/mutation_spec.rb @@ -21,12 +21,6 @@ RSpec.describe Mutant::Result::Mutation do ) end - let(:mutation_subject) do - instance_double( - Mutant::Subject - ) - end - describe '#runtime' do subject { object.runtime } diff --git a/spec/unit/mutant/runner_spec.rb b/spec/unit/mutant/runner_spec.rb index b827a097..8085dc93 100644 --- a/spec/unit/mutant/runner_spec.rb +++ b/spec/unit/mutant/runner_spec.rb @@ -50,17 +50,6 @@ RSpec.describe Mutant::Runner do subject { described_class.call(env) } - context 'when runner finishes immediately' do - let(:status) { instance_double(Mutant::Parallel::Status, done: true, payload: env_result) } - - before do - expect(driver).to receive(:status).and_return(status) - expect(reporter).to receive(:progress).with(status).ordered - expect(driver).to receive(:stop).ordered - expect(reporter).to receive(:report).with(env_result).ordered - end - end - context 'when report iterations are done' do let(:status_a) { instance_double(Mutant::Parallel::Status, done: false) } let(:status_b) { instance_double(Mutant::Parallel::Status, done: true, payload: env_result) } diff --git a/spec/unit/mutant/selector/expression_spec.rb b/spec/unit/mutant/selector/expression_spec.rb index bde74df5..38aebd0b 100644 --- a/spec/unit/mutant/selector/expression_spec.rb +++ b/spec/unit/mutant/selector/expression_spec.rb @@ -19,7 +19,6 @@ RSpec.describe Mutant::Selector::Expression do let(:mutation_subject) { subject_class.new(context, node) } let(:context) { instance_double(Mutant::Context) } let(:node) { instance_double(Parser::AST::Node) } - let(:config) { Mutant::Config::DEFAULT.with(integration: integration) } let(:integration) { instance_double(Mutant::Integration, all_tests: all_tests) } let(:test_a) { instance_double(Mutant::Test, expression: parse_expression('SubjectA')) } let(:test_b) { instance_double(Mutant::Test, expression: parse_expression('SubjectB')) } diff --git a/spec/unit/mutant/subject_spec.rb b/spec/unit/mutant/subject_spec.rb index c516324c..c24aca36 100644 --- a/spec/unit/mutant/subject_spec.rb +++ b/spec/unit/mutant/subject_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Mutant::Subject do RUBY end - let(:expression) do - instance_double(Mutant::Expression, line: 'source_line') - end - let(:context) do double( 'Context',