mutant 0.5.23 → 0.5.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +10 -0
- data/config/flay.yml +1 -1
- data/config/reek.yml +19 -19
- data/lib/mutant.rb +12 -39
- data/lib/mutant/ast.rb +5 -0
- data/lib/mutant/ast/meta.rb +131 -0
- data/lib/mutant/ast/named_children.rb +98 -0
- data/lib/mutant/ast/node_predicates.rb +19 -0
- data/lib/mutant/ast/nodes.rb +21 -0
- data/lib/mutant/ast/sexp.rb +34 -0
- data/lib/mutant/ast/types.rb +48 -0
- data/lib/mutant/cache.rb +3 -2
- data/lib/mutant/cli.rb +11 -151
- data/lib/mutant/config.rb +22 -2
- data/lib/mutant/context/scope.rb +11 -21
- data/lib/mutant/delegator.rb +2 -0
- data/lib/mutant/diff.rb +7 -3
- data/lib/mutant/env.rb +49 -0
- data/lib/mutant/expression.rb +36 -8
- data/lib/mutant/expression/methods.rb +62 -0
- data/lib/mutant/expression/namespace.rb +41 -28
- data/lib/mutant/{strategy.rb → integration.rb} +12 -31
- data/lib/mutant/isolation.rb +1 -1
- data/lib/mutant/matcher.rb +1 -21
- data/lib/mutant/matcher/builder.rb +142 -0
- data/lib/mutant/matcher/method.rb +3 -7
- data/lib/mutant/matcher/method/instance.rb +6 -5
- data/lib/mutant/matcher/method/singleton.rb +2 -7
- data/lib/mutant/matcher/methods.rb +11 -14
- data/lib/mutant/matcher/namespace.rb +31 -39
- data/lib/mutant/matcher/scope.rb +13 -2
- data/lib/mutant/meta.rb +0 -1
- data/lib/mutant/meta/example/dsl.rb +5 -1
- data/lib/mutant/mutator/node.rb +16 -44
- data/lib/mutant/mutator/node/or_asgn.rb +1 -1
- data/lib/mutant/mutator/node/send.rb +5 -60
- data/lib/mutant/mutator/node/super.rb +2 -5
- data/lib/mutant/mutator/registry.rb +1 -1
- data/lib/mutant/reporter.rb +10 -0
- data/lib/mutant/reporter/cli.rb +13 -0
- data/lib/mutant/reporter/cli/printer.rb +2 -0
- data/lib/mutant/reporter/cli/progress/config.rb +1 -1
- data/lib/mutant/reporter/cli/progress/noop.rb +2 -0
- data/lib/mutant/reporter/cli/registry.rb +2 -0
- data/lib/mutant/reporter/null.rb +12 -0
- data/lib/mutant/reporter/trace.rb +4 -0
- data/lib/mutant/require_highjack.rb +2 -2
- data/lib/mutant/rspec.rb +0 -0
- data/lib/mutant/runner.rb +2 -0
- data/lib/mutant/runner/config.rb +8 -8
- data/lib/mutant/runner/killer.rb +5 -0
- data/lib/mutant/runner/subject.rb +1 -1
- data/lib/mutant/subject.rb +8 -8
- data/lib/mutant/subject/method.rb +3 -2
- data/lib/mutant/subject/method/instance.rb +1 -1
- data/lib/mutant/test.rb +7 -65
- data/lib/mutant/test/report.rb +59 -0
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant/warning_filter.rb +2 -0
- data/lib/mutant/zombifier.rb +3 -0
- data/lib/mutant/zombifier/file.rb +1 -1
- data/meta/or_asgn.rb +11 -0
- data/meta/send.rb +1 -1
- data/mutant-rspec.gemspec +1 -1
- data/mutant.gemspec +1 -1
- data/spec/integration/mutant/corpus_spec.rb +2 -0
- data/spec/integration/mutant/test_mutator_handles_types_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -3
- data/spec/unit/mutant/cli_new_spec.rb +11 -11
- data/spec/unit/mutant/expression/methods_spec.rb +43 -0
- data/spec/unit/mutant/expression/namespace/flat_spec.rb +1 -1
- data/spec/unit/mutant/expression/namespace/recursive_spec.rb +19 -5
- data/spec/unit/mutant/{strategy_spec.rb → integration_spec.rb} +1 -1
- data/spec/unit/mutant/isolation_spec.rb +3 -1
- data/spec/unit/mutant/matcher/method/instance_spec.rb +5 -5
- data/spec/unit/mutant/matcher/method/singleton_spec.rb +8 -8
- data/spec/unit/mutant/matcher/methods/instance_spec.rb +5 -8
- data/spec/unit/mutant/matcher/methods/singleton_spec.rb +5 -5
- data/spec/unit/mutant/matcher/namespace_spec.rb +18 -23
- data/spec/unit/mutant/mutation_spec.rb +1 -1
- data/spec/unit/mutant/runner/config_spec.rb +4 -5
- data/spec/unit/mutant/runner/mutation_spec.rb +21 -21
- data/spec/unit/mutant/runner/subject_spec.rb +6 -6
- data/spec/unit/mutant/subject/method/instance_spec.rb +0 -4
- data/spec/unit/mutant/subject/method/singleton_spec.rb +0 -1
- data/spec/unit/mutant/subject_spec.rb +3 -3
- metadata +20 -6
- data/lib/mutant/node_helpers.rb +0 -52
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Mutant::Expression::Methods do
|
4
|
+
|
5
|
+
let(:object) { described_class.parse(input) }
|
6
|
+
let(:cache) { Mutant::Cache.new }
|
7
|
+
let(:instance_methods) { 'TestApp::Literal#' }
|
8
|
+
let(:singleton_methods) { 'TestApp::Literal.' }
|
9
|
+
|
10
|
+
describe '#match_length' do
|
11
|
+
let(:input) { instance_methods }
|
12
|
+
|
13
|
+
subject { object.match_length(other) }
|
14
|
+
|
15
|
+
context 'when other is an equivalent expression' do
|
16
|
+
let(:other) { described_class.parse(object.syntax) }
|
17
|
+
|
18
|
+
it { should be(object.syntax.length) }
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when other is an unequivalent expression' do
|
22
|
+
let(:other) { described_class.parse('Foo*') }
|
23
|
+
|
24
|
+
it { should be(0) }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#matcher' do
|
29
|
+
subject { object.matcher(cache) }
|
30
|
+
|
31
|
+
context 'with an instance method' do
|
32
|
+
let(:input) { instance_methods }
|
33
|
+
|
34
|
+
it { should eql(Mutant::Matcher::Methods::Instance.new(cache, TestApp::Literal)) }
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'with a singleton method' do
|
38
|
+
let(:input) { singleton_methods }
|
39
|
+
|
40
|
+
it { should eql(Mutant::Matcher::Methods::Singleton.new(cache, TestApp::Literal)) }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -9,7 +9,7 @@ describe Mutant::Expression::Namespace::Exact do
|
|
9
9
|
describe '#matcher' do
|
10
10
|
subject { object.matcher(cache) }
|
11
11
|
|
12
|
-
it { should eql(Mutant::Matcher::
|
12
|
+
it { should eql(Mutant::Matcher::Scope.new(cache, TestApp::Literal)) }
|
13
13
|
end
|
14
14
|
|
15
15
|
describe '#match_length' do
|
@@ -3,12 +3,12 @@ require 'spec_helper'
|
|
3
3
|
describe Mutant::Expression::Namespace::Recursive do
|
4
4
|
|
5
5
|
let(:object) { described_class.parse(input) }
|
6
|
-
let(:cache) { Mutant::Cache.new
|
7
|
-
let(:input) { 'TestApp::Literal*'
|
6
|
+
let(:cache) { Mutant::Cache.new }
|
7
|
+
let(:input) { 'TestApp::Literal*' }
|
8
8
|
|
9
9
|
describe '#matcher' do
|
10
10
|
subject { object.matcher(cache) }
|
11
|
-
it { should eql(Mutant::Matcher::Namespace.new(cache,
|
11
|
+
it { should eql(Mutant::Matcher::Namespace.new(cache, object)) }
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#match_length' do
|
@@ -33,9 +33,23 @@ describe Mutant::Expression::Namespace::Recursive do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
context 'when other expression describes a longer prefix' do
|
36
|
-
|
36
|
+
context 'on constants' do
|
37
|
+
let(:other) { described_class.parse('TestApp::Literal::Deep') }
|
37
38
|
|
38
|
-
|
39
|
+
it { should be(input[0..-2].length) }
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'on singleton method' do
|
43
|
+
let(:other) { described_class.parse('TestApp::Literal.foo') }
|
44
|
+
|
45
|
+
it { should be(input[0..-2].length) }
|
46
|
+
end
|
47
|
+
|
48
|
+
context 'on instance method' do
|
49
|
+
let(:other) { described_class.parse('TestApp::Literal#foo') }
|
50
|
+
|
51
|
+
it { should be(input[0..-2].length) }
|
52
|
+
end
|
39
53
|
end
|
40
54
|
end
|
41
55
|
end
|
@@ -5,7 +5,9 @@ describe Mutant::Isolation do
|
|
5
5
|
let(:object) { described_class }
|
6
6
|
|
7
7
|
it 'isolates global effects from process' do
|
8
|
-
expect
|
8
|
+
expect(defined?(::TestConstant)).to be(nil)
|
9
|
+
object.call { ::TestConstant = 1 }
|
10
|
+
expect(defined?(::TestConstant)).to be(nil)
|
9
11
|
end
|
10
12
|
|
11
13
|
it 'return block value' do
|
@@ -3,12 +3,12 @@ require 'spec_helper'
|
|
3
3
|
# rubocop:disable ClassAndModuleChildren
|
4
4
|
describe Mutant::Matcher::Method::Instance do
|
5
5
|
|
6
|
-
let(:
|
6
|
+
let(:env) { Fixtures::BOOT_ENV }
|
7
7
|
|
8
8
|
describe '#each' do
|
9
9
|
subject { object.each { |subject| yields << subject } }
|
10
10
|
|
11
|
-
let(:object) { described_class.new(
|
11
|
+
let(:object) { described_class.new(env, scope, method) }
|
12
12
|
let(:method) { scope.instance_method(method_name) }
|
13
13
|
let(:yields) { [] }
|
14
14
|
let(:namespace) { self.class }
|
@@ -118,7 +118,7 @@ describe Mutant::Matcher::Method::Instance do
|
|
118
118
|
describe '.build' do
|
119
119
|
let(:object) { described_class }
|
120
120
|
|
121
|
-
subject { object.build(
|
121
|
+
subject { object.build(env, scope, method) }
|
122
122
|
|
123
123
|
let(:scope) do
|
124
124
|
Class.new do
|
@@ -141,13 +141,13 @@ describe Mutant::Matcher::Method::Instance do
|
|
141
141
|
context 'with unmemoized method' do
|
142
142
|
let(:method_name) { :bar }
|
143
143
|
|
144
|
-
it { should eql(described_class.new(
|
144
|
+
it { should eql(described_class.new(env, scope, method)) }
|
145
145
|
end
|
146
146
|
|
147
147
|
context 'with memoized method' do
|
148
148
|
let(:method_name) { :foo }
|
149
149
|
|
150
|
-
it { should eql(described_class::Memoized.new(
|
150
|
+
it { should eql(described_class::Memoized.new(env, scope, method)) }
|
151
151
|
end
|
152
152
|
end
|
153
153
|
end
|
@@ -4,14 +4,14 @@ require 'spec_helper'
|
|
4
4
|
describe Mutant::Matcher::Method::Singleton, '#each' do
|
5
5
|
subject { object.each { |subject| yields << subject } }
|
6
6
|
|
7
|
-
let(:object) { described_class.new(
|
8
|
-
let(:method) { scope.method(method_name)
|
9
|
-
let(:
|
10
|
-
let(:yields) { []
|
11
|
-
let(:namespace) { self.class
|
12
|
-
let(:scope) { self.class::Foo
|
13
|
-
let(:type) { :defs
|
14
|
-
let(:method_arity) { 0
|
7
|
+
let(:object) { described_class.new(env, scope, method) }
|
8
|
+
let(:method) { scope.method(method_name) }
|
9
|
+
let(:env) { Fixtures::BOOT_ENV }
|
10
|
+
let(:yields) { [] }
|
11
|
+
let(:namespace) { self.class }
|
12
|
+
let(:scope) { self.class::Foo }
|
13
|
+
let(:type) { :defs }
|
14
|
+
let(:method_arity) { 0 }
|
15
15
|
|
16
16
|
def name
|
17
17
|
node.children[1]
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Mutant::Matcher::Methods::Instance, '#each' do
|
4
|
-
let(:object) { described_class.new(
|
5
|
-
let(:
|
4
|
+
let(:object) { described_class.new(env, Foo) }
|
5
|
+
let(:env) { Fixtures::BOOT_ENV }
|
6
6
|
|
7
7
|
subject { object.each { |matcher| yields << matcher } }
|
8
8
|
|
@@ -46,12 +46,9 @@ describe Mutant::Matcher::Methods::Instance, '#each' do
|
|
46
46
|
|
47
47
|
before do
|
48
48
|
matcher = Mutant::Matcher::Method::Instance
|
49
|
-
matcher.
|
50
|
-
|
51
|
-
matcher.
|
52
|
-
.with(cache, Foo, Foo.instance_method(:method_b)).and_return([subject_b])
|
53
|
-
matcher.stub(:new)
|
54
|
-
.with(cache, Foo, Foo.instance_method(:method_c)).and_return([subject_c])
|
49
|
+
allow(matcher).to receive(:new).with(env, Foo, Foo.instance_method(:method_a)).and_return([subject_a])
|
50
|
+
allow(matcher).to receive(:new).with(env, Foo, Foo.instance_method(:method_b)).and_return([subject_b])
|
51
|
+
allow(matcher).to receive(:new).with(env, Foo, Foo.instance_method(:method_c)).and_return([subject_c])
|
55
52
|
end
|
56
53
|
|
57
54
|
it 'should yield expected subjects' do
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Mutant::Matcher::Methods::Singleton, '#each' do
|
4
|
-
let(:object) { described_class.new(
|
5
|
-
let(:
|
4
|
+
let(:object) { described_class.new(env, Foo) }
|
5
|
+
let(:env) { Fixtures::BOOT_ENV }
|
6
6
|
|
7
7
|
subject { object.each { |matcher| yields << matcher } }
|
8
8
|
|
@@ -41,11 +41,11 @@ describe Mutant::Matcher::Methods::Singleton, '#each' do
|
|
41
41
|
before do
|
42
42
|
matcher = Mutant::Matcher::Method::Singleton
|
43
43
|
matcher.stub(:new)
|
44
|
-
.with(
|
44
|
+
.with(env, Foo, Foo.method(:method_a)).and_return([subject_a])
|
45
45
|
matcher.stub(:new)
|
46
|
-
.with(
|
46
|
+
.with(env, Foo, Foo.method(:method_b)).and_return([subject_b])
|
47
47
|
matcher.stub(:new)
|
48
|
-
.with(
|
48
|
+
.with(env, Foo, Foo.method(:method_c)).and_return([subject_c])
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'should yield expected subjects' do
|
@@ -1,29 +1,28 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Mutant::Matcher::Namespace do
|
4
|
-
let(:object) { described_class.new(
|
5
|
-
let(:yields) { []
|
6
|
-
|
7
|
-
let(:cache) { Mutant::Cache.new }
|
4
|
+
let(:object) { described_class.new(env, Mutant::Expression.parse('TestApp*')) }
|
5
|
+
let(:yields) { [] }
|
6
|
+
let(:env) { Fixtures::BOOT_ENV }
|
8
7
|
|
9
8
|
subject { object.each { |item| yields << item } }
|
10
9
|
|
11
10
|
describe '#each' do
|
12
11
|
|
13
|
-
let(:singleton_a) { double('SingletonA', name: 'TestApp::Literal')
|
14
|
-
let(:singleton_b) { double('SingletonB', name: 'TestApp::Foo')
|
15
|
-
let(:singleton_c) { double('SingletonC', name: '
|
16
|
-
let(:subject_a) { double('SubjectA')
|
17
|
-
let(:subject_b) { double('SubjectB')
|
12
|
+
let(:singleton_a) { double('SingletonA', name: 'TestApp::Literal') }
|
13
|
+
let(:singleton_b) { double('SingletonB', name: 'TestApp::Foo') }
|
14
|
+
let(:singleton_c) { double('SingletonC', name: 'TestAppOther') }
|
15
|
+
let(:subject_a) { double('SubjectA') }
|
16
|
+
let(:subject_b) { double('SubjectB') }
|
18
17
|
|
19
18
|
before do
|
20
|
-
Mutant::Matcher::Methods::Singleton.
|
21
|
-
|
22
|
-
|
23
|
-
Mutant::Matcher::Methods::
|
24
|
-
|
25
|
-
|
26
|
-
ObjectSpace.
|
19
|
+
allow(Mutant::Matcher::Methods::Singleton).to receive(:new).with(env, singleton_a).and_return([subject_a])
|
20
|
+
allow(Mutant::Matcher::Methods::Instance).to receive(:new).with(env, singleton_a).and_return([])
|
21
|
+
|
22
|
+
allow(Mutant::Matcher::Methods::Singleton).to receive(:new).with(env, singleton_b).and_return([subject_b])
|
23
|
+
allow(Mutant::Matcher::Methods::Instance).to receive(:new).with(env, singleton_b).and_return([])
|
24
|
+
|
25
|
+
allow(ObjectSpace).to receive(:each_object).with(Module).and_return([singleton_a, singleton_b, singleton_c])
|
27
26
|
end
|
28
27
|
|
29
28
|
context 'with no block' do
|
@@ -31,17 +30,13 @@ describe Mutant::Matcher::Namespace do
|
|
31
30
|
|
32
31
|
it { should be_instance_of(to_enum.class) }
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
else
|
37
|
-
it 'yields the expected values' do
|
38
|
-
expect(subject.to_a).to eql(object.to_a)
|
39
|
-
end
|
33
|
+
it 'yields the expected values' do
|
34
|
+
expect(subject.to_a).to eql(object.to_a)
|
40
35
|
end
|
41
36
|
end
|
42
37
|
|
43
38
|
it 'should yield subjects' do
|
44
|
-
expect { subject }.to change { yields }.from([]).to([
|
39
|
+
expect { subject }.to change { yields }.from([]).to([subject_b, subject_a])
|
45
40
|
end
|
46
41
|
end
|
47
42
|
end
|
@@ -6,7 +6,7 @@ describe Mutant::Mutation do
|
|
6
6
|
SYMBOL = 'test'.freeze
|
7
7
|
end
|
8
8
|
|
9
|
-
let(:object) { TestMutation.new(mutation_subject, Mutant::
|
9
|
+
let(:object) { TestMutation.new(mutation_subject, Mutant::AST::Nodes::N_NIL) }
|
10
10
|
let(:mutation_subject) { double('Subject', identification: 'subject', source: 'original') }
|
11
11
|
let(:node) { double('Node') }
|
12
12
|
|
@@ -6,9 +6,8 @@ describe Mutant::Runner::Config do
|
|
6
6
|
let(:config) do
|
7
7
|
Mutant::Config.new(
|
8
8
|
matcher: [subject_a, subject_b],
|
9
|
-
cache: Mutant::Cache.new,
|
10
9
|
debug: false,
|
11
|
-
|
10
|
+
integration: integration,
|
12
11
|
reporter: reporter,
|
13
12
|
fail_fast: fail_fast,
|
14
13
|
expected_coverage: expected_coverage,
|
@@ -19,13 +18,13 @@ describe Mutant::Runner::Config do
|
|
19
18
|
let(:fail_fast) { false }
|
20
19
|
let(:expected_coverage) { 100.0 }
|
21
20
|
let(:reporter) { Mutant::Reporter::Trace.new }
|
22
|
-
let(:
|
21
|
+
let(:integration) { double('Integration') }
|
23
22
|
let(:subject_a) { double('Subject A') }
|
24
23
|
let(:subject_b) { double('Subject B') }
|
25
24
|
|
26
25
|
before do
|
27
|
-
|
28
|
-
|
26
|
+
integration.stub(:setup)
|
27
|
+
integration.stub(:teardown)
|
29
28
|
Mutant::Runner.stub(:run).with(config, subject_a).and_return(runner_a)
|
30
29
|
Mutant::Runner.stub(:run).with(config, subject_b).and_return(runner_b)
|
31
30
|
end
|
@@ -3,25 +3,25 @@ require 'spec_helper'
|
|
3
3
|
describe Mutant::Runner::Mutation do
|
4
4
|
let(:object) { described_class.new(config, mutation, tests) }
|
5
5
|
|
6
|
-
let(:reporter)
|
7
|
-
let(:mutation)
|
8
|
-
let(:
|
9
|
-
let(:killer_a)
|
10
|
-
let(:killer_b)
|
11
|
-
let(:runner_a)
|
12
|
-
let(:runner_b)
|
13
|
-
let(:runners)
|
14
|
-
let(:killers)
|
15
|
-
let(:fail_fast)
|
16
|
-
let(:success_a)
|
17
|
-
let(:success_b)
|
18
|
-
let(:stop_a)
|
19
|
-
let(:stop_b)
|
20
|
-
let(:dead_a)
|
21
|
-
let(:dead_b)
|
22
|
-
let(:test_a)
|
23
|
-
let(:test_b)
|
24
|
-
let(:tests)
|
6
|
+
let(:reporter) { double('Reporter') }
|
7
|
+
let(:mutation) { double('Mutation', class: Mutant::Mutation) }
|
8
|
+
let(:integration) { double('Integration') }
|
9
|
+
let(:killer_a) { Mutant::Killer.new(test: test_a, mutation: mutation) }
|
10
|
+
let(:killer_b) { Mutant::Killer.new(test: test_b, mutation: mutation) }
|
11
|
+
let(:runner_a) { double('Runner A', success?: success_a, stop?: stop_a, mutation_dead?: dead_a) }
|
12
|
+
let(:runner_b) { double('Runner B', success?: success_b, stop?: stop_b, mutation_dead?: dead_b) }
|
13
|
+
let(:runners) { [runner_a, runner_b] }
|
14
|
+
let(:killers) { [killer_a, killer_b] }
|
15
|
+
let(:fail_fast) { false }
|
16
|
+
let(:success_a) { true }
|
17
|
+
let(:success_b) { true }
|
18
|
+
let(:stop_a) { false }
|
19
|
+
let(:stop_b) { false }
|
20
|
+
let(:dead_a) { false }
|
21
|
+
let(:dead_b) { false }
|
22
|
+
let(:test_a) { double('test a') }
|
23
|
+
let(:test_b) { double('test b') }
|
24
|
+
let(:tests) { [test_a, test_b] }
|
25
25
|
|
26
26
|
before do
|
27
27
|
expect(Mutant::Runner).to receive(:run).with(config, killer_a).and_return(runner_a)
|
@@ -33,13 +33,13 @@ describe Mutant::Runner::Mutation do
|
|
33
33
|
'Config',
|
34
34
|
fail_fast: fail_fast,
|
35
35
|
reporter: reporter,
|
36
|
-
|
36
|
+
integration: integration
|
37
37
|
)
|
38
38
|
end
|
39
39
|
|
40
40
|
before do
|
41
41
|
reporter.stub(progress: reporter)
|
42
|
-
|
42
|
+
integration.stub(killers: killers)
|
43
43
|
end
|
44
44
|
|
45
45
|
describe '#stop?' do
|
@@ -13,11 +13,11 @@ describe Mutant::Runner::Subject, '#success?' do
|
|
13
13
|
)
|
14
14
|
end
|
15
15
|
|
16
|
-
let(:reporter)
|
17
|
-
let(:config)
|
18
|
-
let(:mutation_a)
|
19
|
-
let(:mutation_b)
|
20
|
-
let(:
|
16
|
+
let(:reporter) { Mutant::Reporter::Trace.new }
|
17
|
+
let(:config) { double('Config', reporter: reporter, integration: integration) }
|
18
|
+
let(:mutation_a) { double('Mutation A') }
|
19
|
+
let(:mutation_b) { double('Mutation B') }
|
20
|
+
let(:integration) { double('Integration') }
|
21
21
|
|
22
22
|
let(:runner_a) do
|
23
23
|
double('Runner A', success?: success_a, stop?: stop_a)
|
@@ -30,7 +30,7 @@ describe Mutant::Runner::Subject, '#success?' do
|
|
30
30
|
let(:tests) { [double('test a'), double('test b')] }
|
31
31
|
|
32
32
|
before do
|
33
|
-
expect(
|
33
|
+
expect(config).to receive(:tests).with(mutation_subject).and_return(tests)
|
34
34
|
expect(Mutant::Runner).to receive(:run).with(config, mutation_a, tests).and_return(runner_a)
|
35
35
|
expect(Mutant::Runner).to receive(:run).with(config, mutation_b, tests).and_return(runner_b)
|
36
36
|
end
|
@@ -3,8 +3,6 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Mutant::Subject::Method::Instance do
|
6
|
-
include Mutant::NodeHelpers
|
7
|
-
|
8
6
|
let(:object) { described_class.new(context, node) }
|
9
7
|
let(:context) { double }
|
10
8
|
|
@@ -73,8 +71,6 @@ describe Mutant::Subject::Method::Instance do
|
|
73
71
|
end
|
74
72
|
|
75
73
|
describe Mutant::Subject::Method::Instance::Memoized do
|
76
|
-
include Mutant::NodeHelpers
|
77
|
-
|
78
74
|
let(:object) { described_class.new(context, node) }
|
79
75
|
let(:context) { double }
|
80
76
|
|