mutant 0.5.26 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/.travis.yml +1 -0
  4. data/Changelog.md +16 -3
  5. data/Gemfile +0 -2
  6. data/Gemfile.devtools +2 -2
  7. data/README.md +9 -15
  8. data/bin/mutant +0 -1
  9. data/config/flay.yml +1 -1
  10. data/config/flog.yml +1 -1
  11. data/config/mutant.yml +1 -1
  12. data/config/reek.yml +14 -11
  13. data/config/rubocop.yml +1 -1
  14. data/lib/mutant.rb +22 -21
  15. data/lib/mutant/ast.rb +47 -0
  16. data/lib/mutant/cli.rb +7 -4
  17. data/lib/mutant/config.rb +1 -0
  18. data/lib/mutant/context.rb +1 -1
  19. data/lib/mutant/diff.rb +38 -7
  20. data/lib/mutant/env.rb +22 -3
  21. data/lib/mutant/expression.rb +15 -4
  22. data/lib/mutant/integration.rb +1 -1
  23. data/lib/mutant/isolation.rb +2 -4
  24. data/lib/mutant/matcher.rb +1 -1
  25. data/lib/mutant/matcher/method.rb +1 -1
  26. data/lib/mutant/matcher/method/singleton.rb +1 -1
  27. data/lib/mutant/matcher/methods.rb +0 -2
  28. data/lib/mutant/meta/example.rb +0 -2
  29. data/lib/mutant/meta/example/dsl.rb +1 -1
  30. data/lib/mutant/mutator.rb +1 -1
  31. data/lib/mutant/mutator/node.rb +3 -3
  32. data/lib/mutant/mutator/node/begin.rb +1 -1
  33. data/lib/mutant/mutator/node/block.rb +16 -3
  34. data/lib/mutant/mutator/node/if.rb +1 -1
  35. data/lib/mutant/mutator/node/literal/fixnum.rb +1 -1
  36. data/lib/mutant/mutator/node/resbody.rb +0 -2
  37. data/lib/mutant/mutator/node/send.rb +17 -7
  38. data/lib/mutant/mutator/node/send/index.rb +0 -2
  39. data/lib/mutant/mutator/registry.rb +1 -1
  40. data/lib/mutant/mutator/util.rb +1 -1
  41. data/lib/mutant/mutator/util/array.rb +1 -1
  42. data/lib/mutant/reporter.rb +13 -3
  43. data/lib/mutant/reporter/cli.rb +54 -8
  44. data/lib/mutant/reporter/cli/format.rb +197 -0
  45. data/lib/mutant/reporter/cli/printer.rb +402 -22
  46. data/lib/mutant/reporter/cli/tput.rb +27 -0
  47. data/lib/mutant/reporter/null.rb +4 -34
  48. data/lib/mutant/reporter/trace.rb +6 -38
  49. data/lib/mutant/result.rb +44 -56
  50. data/lib/mutant/runner.rb +99 -52
  51. data/lib/mutant/runner/collector.rb +134 -0
  52. data/lib/mutant/subject/method/instance.rb +12 -4
  53. data/lib/mutant/version.rb +1 -1
  54. data/lib/mutant/warning_filter.rb +0 -2
  55. data/lib/mutant/zombifier/file.rb +1 -1
  56. data/meta/block.rb +17 -1
  57. data/meta/send.rb +123 -1
  58. data/mutant-rspec.gemspec +3 -3
  59. data/mutant.gemspec +1 -1
  60. data/spec/integration/mutant/corpus_spec.rb +4 -195
  61. data/spec/integration/mutant/null_spec.rb +1 -3
  62. data/spec/integration/mutant/rspec_spec.rb +1 -3
  63. data/spec/integration/mutant/test_mutator_handles_types_spec.rb +1 -3
  64. data/spec/integration/mutant/zombie_spec.rb +1 -3
  65. data/spec/integrations.yml +7 -0
  66. data/spec/shared/method_matcher_behavior.rb +1 -1
  67. data/spec/spec_helper.rb +1 -0
  68. data/spec/support/compress_helper.rb +1 -0
  69. data/spec/support/corpus.rb +239 -0
  70. data/spec/support/mutation_verifier.rb +2 -4
  71. data/spec/unit/mutant/cli_spec.rb +20 -13
  72. data/spec/unit/mutant/context/root_spec.rb +1 -3
  73. data/spec/unit/mutant/context/scope/root_spec.rb +1 -3
  74. data/spec/unit/mutant/context/scope/unqualified_name_spec.rb +1 -3
  75. data/spec/unit/mutant/diff_spec.rb +37 -19
  76. data/spec/unit/mutant/expression/method_spec.rb +5 -7
  77. data/spec/unit/mutant/expression/methods_spec.rb +5 -7
  78. data/spec/unit/mutant/expression/namespace/flat_spec.rb +6 -8
  79. data/spec/unit/mutant/expression/namespace/recursive_spec.rb +6 -7
  80. data/spec/unit/mutant/expression_spec.rb +14 -5
  81. data/spec/unit/mutant/integration_spec.rb +14 -3
  82. data/spec/unit/mutant/isolation_spec.rb +2 -4
  83. data/spec/unit/mutant/loader/eval_spec.rb +1 -3
  84. data/spec/unit/mutant/matcher/chain_spec.rb +1 -3
  85. data/spec/unit/mutant/matcher/compiler/subject_prefix_spec.rb +21 -0
  86. data/spec/unit/mutant/matcher/compiler_spec.rb +28 -3
  87. data/spec/unit/mutant/matcher/filter_spec.rb +1 -3
  88. data/spec/unit/mutant/matcher/method/instance_spec.rb +3 -5
  89. data/spec/unit/mutant/matcher/method/singleton_spec.rb +22 -4
  90. data/spec/unit/mutant/matcher/methods/instance_spec.rb +7 -6
  91. data/spec/unit/mutant/matcher/methods/singleton_spec.rb +4 -6
  92. data/spec/unit/mutant/matcher/namespace_spec.rb +1 -3
  93. data/spec/unit/mutant/matcher/null_spec.rb +1 -3
  94. data/spec/unit/mutant/mutation_spec.rb +1 -3
  95. data/spec/unit/mutant/mutator/node_spec.rb +1 -3
  96. data/spec/unit/mutant/reporter/cli_spec.rb +444 -206
  97. data/spec/unit/mutant/reporter/null_spec.rb +1 -3
  98. data/spec/unit/mutant/require_highjack_spec.rb +1 -3
  99. data/spec/unit/mutant/runner_spec.rb +42 -28
  100. data/spec/unit/mutant/subject/context_spec.rb +1 -3
  101. data/spec/unit/mutant/subject/method/instance_spec.rb +27 -19
  102. data/spec/unit/mutant/subject/method/singleton_spec.rb +49 -17
  103. data/spec/unit/mutant/subject_spec.rb +1 -3
  104. data/spec/unit/mutant/test_spec.rb +1 -3
  105. data/spec/unit/mutant/warning_expectation.rb +1 -3
  106. data/spec/unit/mutant/warning_filter_spec.rb +1 -3
  107. data/spec/unit/mutant_spec.rb +13 -3
  108. data/test_app/Gemfile.devtools +2 -2
  109. data/test_app/spec/unit/test_app/literal/string_spec.rb +1 -1
  110. metadata +10 -21
  111. data/lib/mutant/matcher/method/finder.rb +0 -72
  112. data/lib/mutant/reporter/cli/progress.rb +0 -10
  113. data/lib/mutant/reporter/cli/progress/config.rb +0 -30
  114. data/lib/mutant/reporter/cli/progress/env.rb +0 -30
  115. data/lib/mutant/reporter/cli/progress/noop.rb +0 -27
  116. data/lib/mutant/reporter/cli/progress/result.rb +0 -12
  117. data/lib/mutant/reporter/cli/progress/result/mutation.rb +0 -45
  118. data/lib/mutant/reporter/cli/progress/result/subject.rb +0 -54
  119. data/lib/mutant/reporter/cli/progress/subject.rb +0 -27
  120. data/lib/mutant/reporter/cli/registry.rb +0 -81
  121. data/lib/mutant/reporter/cli/report.rb +0 -10
  122. data/lib/mutant/reporter/cli/report/env.rb +0 -92
  123. data/lib/mutant/reporter/cli/report/mutation.rb +0 -103
  124. data/lib/mutant/reporter/cli/report/subject.rb +0 -32
  125. data/lib/mutant/reporter/cli/report/test.rb +0 -28
  126. data/lib/mutant/walker.rb +0 -53
  127. data/spec/shared/mutator_behavior.rb +0 -55
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Diff do
1
+ RSpec.describe Mutant::Diff do
4
2
  let(:object) { described_class }
5
3
 
6
4
  describe '.build' do
@@ -14,27 +12,27 @@ describe Mutant::Diff do
14
12
 
15
13
  end
16
14
 
17
- describe '.colorize_line' do
18
- let(:object) { described_class }
19
-
20
- subject { object.colorize_line(line) }
21
-
22
- context 'line beginning with "+"' do
23
- let(:line) { '+line' }
15
+ describe '#colorized_diff' do
16
+ let(:object) { described_class.new(old, new) }
24
17
 
25
- it { should eql(Mutant::Color::GREEN.format(line)) }
26
- end
18
+ subject { object.colorized_diff }
27
19
 
28
- context 'line beginning with "-"' do
29
- let(:line) { '-line' }
20
+ context 'when there is a diff at begin of hunk' do
21
+ let(:old) { %w[foo bar] }
22
+ let(:new) { %w[baz bar] }
30
23
 
31
- it { should eql(Mutant::Color::RED.format(line)) }
32
- end
24
+ let(:expectation) do
25
+ [
26
+ "@@ -1,3 +1,3 @@\n",
27
+ Mutant::Color::RED.format("-foo\n"),
28
+ Mutant::Color::GREEN.format("+baz\n"),
29
+ " bar\n"
30
+ ].join
31
+ end
33
32
 
34
- context 'line beginning in other char' do
35
- let(:line) { ' line' }
33
+ it { should eql(expectation) }
36
34
 
37
- it { should eql(line) }
35
+ it_should_behave_like 'an idempotent method'
38
36
  end
39
37
  end
40
38
 
@@ -43,6 +41,26 @@ describe Mutant::Diff do
43
41
 
44
42
  subject { object.diff }
45
43
 
44
+ context 'when there is a diff at begin and end' do
45
+ let(:old) { %w[foo bar foo] }
46
+ let(:new) { %w[baz bar baz] }
47
+
48
+ let(:expectation) do
49
+ strip_indent(<<-STR)
50
+ @@ -1,4 +1,4 @@
51
+ -foo
52
+ +baz
53
+ bar
54
+ -foo
55
+ +baz
56
+ STR
57
+ end
58
+
59
+ it { should eql(expectation) }
60
+
61
+ it_should_behave_like 'an idempotent method'
62
+ end
63
+
46
64
  context 'when there is a diff at begin of hunk' do
47
65
  let(:old) { %w[foo bar] }
48
66
  let(:new) { %w[baz bar] }
@@ -1,9 +1,7 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Expression::Method do
1
+ RSpec.describe Mutant::Expression::Method do
4
2
 
5
3
  let(:object) { described_class.parse(input) }
6
- let(:cache) { Mutant::Cache.new }
4
+ let(:env) { Fixtures::TEST_ENV }
7
5
  let(:instance_method) { 'TestApp::Literal#string' }
8
6
  let(:singleton_method) { 'TestApp::Literal.string' }
9
7
 
@@ -26,14 +24,14 @@ describe Mutant::Expression::Method do
26
24
  end
27
25
 
28
26
  describe '#matcher' do
29
- subject { object.matcher(cache) }
27
+ subject { object.matcher(env) }
30
28
 
31
29
  context 'with an instance method' do
32
30
  let(:input) { instance_method }
33
31
 
34
32
  it 'returns correct matcher' do
35
33
  should eql(Mutant::Matcher::Method::Instance.new(
36
- cache,
34
+ env,
37
35
  TestApp::Literal, TestApp::Literal.instance_method(:string)
38
36
  ))
39
37
  end
@@ -42,7 +40,7 @@ describe Mutant::Expression::Method do
42
40
  context 'with a singleton method' do
43
41
  let(:input) { singleton_method }
44
42
 
45
- it { should eql(Mutant::Matcher::Method::Singleton.new(cache, TestApp::Literal, TestApp::Literal.method(:string))) }
43
+ it { should eql(Mutant::Matcher::Method::Singleton.new(env, TestApp::Literal, TestApp::Literal.method(:string))) }
46
44
  end
47
45
  end
48
46
  end
@@ -1,9 +1,7 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Expression::Methods do
1
+ RSpec.describe Mutant::Expression::Methods do
4
2
 
5
3
  let(:object) { described_class.parse(input) }
6
- let(:cache) { Mutant::Cache.new }
4
+ let(:env) { Fixtures::TEST_ENV }
7
5
  let(:instance_methods) { 'TestApp::Literal#' }
8
6
  let(:singleton_methods) { 'TestApp::Literal.' }
9
7
 
@@ -26,18 +24,18 @@ describe Mutant::Expression::Methods do
26
24
  end
27
25
 
28
26
  describe '#matcher' do
29
- subject { object.matcher(cache) }
27
+ subject { object.matcher(env) }
30
28
 
31
29
  context 'with an instance method' do
32
30
  let(:input) { instance_methods }
33
31
 
34
- it { should eql(Mutant::Matcher::Methods::Instance.new(cache, TestApp::Literal)) }
32
+ it { should eql(Mutant::Matcher::Methods::Instance.new(env, TestApp::Literal)) }
35
33
  end
36
34
 
37
35
  context 'with a singleton method' do
38
36
  let(:input) { singleton_methods }
39
37
 
40
- it { should eql(Mutant::Matcher::Methods::Singleton.new(cache, TestApp::Literal)) }
38
+ it { should eql(Mutant::Matcher::Methods::Singleton.new(env, TestApp::Literal)) }
41
39
  end
42
40
  end
43
41
  end
@@ -1,15 +1,13 @@
1
- require 'spec_helper'
1
+ RSpec.describe Mutant::Expression::Namespace::Exact do
2
2
 
3
- describe Mutant::Expression::Namespace::Exact do
4
-
5
- let(:object) { described_class.parse(input) }
6
- let(:cache) { Mutant::Cache.new }
7
- let(:input) { 'TestApp::Literal' }
3
+ let(:object) { described_class.parse(input) }
4
+ let(:env) { Fixtures::TEST_ENV }
5
+ let(:input) { 'TestApp::Literal' }
8
6
 
9
7
  describe '#matcher' do
10
- subject { object.matcher(cache) }
8
+ subject { object.matcher(env) }
11
9
 
12
- it { should eql(Mutant::Matcher::Scope.new(cache, TestApp::Literal, object)) }
10
+ it { should eql(Mutant::Matcher::Scope.new(env, TestApp::Literal, object)) }
13
11
  end
14
12
 
15
13
  describe '#match_length' do
@@ -1,14 +1,13 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Expression::Namespace::Recursive do
1
+ RSpec.describe Mutant::Expression::Namespace::Recursive do
4
2
 
5
3
  let(:object) { described_class.parse(input) }
6
- let(:cache) { Mutant::Cache.new }
7
- let(:input) { 'TestApp::Literal*' }
4
+ let(:input) { 'TestApp::Literal*' }
5
+ let(:env) { Fixtures::TEST_ENV }
8
6
 
9
7
  describe '#matcher' do
10
- subject { object.matcher(cache) }
11
- it { should eql(Mutant::Matcher::Namespace.new(cache, object)) }
8
+ subject { object.matcher(env) }
9
+
10
+ it { should eql(Mutant::Matcher::Namespace.new(env, object)) }
12
11
  end
13
12
 
14
13
  describe '#match_length' do
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Expression do
1
+ RSpec.describe Mutant::Expression do
4
2
  let(:object) { described_class }
5
3
 
6
4
  describe '.try_parse' do
@@ -18,7 +16,7 @@ describe Mutant::Expression do
18
16
  it { should eql(Mutant::Expression::Namespace::Exact.new('Foo')) }
19
17
  end
20
18
 
21
- context 'on ambigious expression' do
19
+ context 'on ambiguous expression' do
22
20
  class ExpressionA < Mutant::Expression
23
21
  register(/\Atest-syntax\z/)
24
22
  end
@@ -30,11 +28,22 @@ describe Mutant::Expression do
30
28
  let(:input) { 'test-syntax' }
31
29
 
32
30
  it 'raises an exception' do
33
- expect { subject }.to raise_error(Mutant::Expression::AmbigousExpressionError, 'Ambigous expression: "test-syntax"')
31
+ expect { subject }.to raise_error(
32
+ Mutant::Expression::AmbiguousExpressionError,
33
+ 'Ambiguous expression: "test-syntax"'
34
+ )
34
35
  end
35
36
  end
36
37
  end
37
38
 
39
+ describe '#inspect' do
40
+ let(:object) { described_class.parse('Foo') }
41
+ subject { object.inspect }
42
+
43
+ it { should eql('<Mutant::Expression: Foo>') }
44
+ it_should_behave_like 'an idempotent method'
45
+ end
46
+
38
47
  describe '.parse' do
39
48
  subject { object.parse(input) }
40
49
 
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Integration do
1
+ RSpec.describe Mutant::Integration do
4
2
 
5
3
  let(:class_under_test) do
6
4
  Class.new(described_class)
@@ -13,3 +11,16 @@ describe Mutant::Integration do
13
11
  it_should_behave_like 'a command method'
14
12
  end
15
13
  end
14
+
15
+ RSpec.describe Mutant::Integration::Null do
16
+
17
+ let(:object) { described_class.new }
18
+
19
+ describe '#setup' do
20
+ subject { object.all_tests }
21
+
22
+ it { should eql([]) }
23
+
24
+ it_should_behave_like 'an idempotent method'
25
+ end
26
+ end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Isolation::None do
1
+ RSpec.describe Mutant::Isolation::None do
4
2
  before do
5
3
  @initial = 1
6
4
  end
@@ -24,7 +22,7 @@ describe Mutant::Isolation::None do
24
22
  end
25
23
  end
26
24
 
27
- describe Mutant::Isolation::Fork do
25
+ RSpec.describe Mutant::Isolation::Fork do
28
26
  before do
29
27
  @initial = 1
30
28
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Loader::Eval, '.call' do
1
+ RSpec.describe Mutant::Loader::Eval, '.call' do
4
2
 
5
3
  subject { object.call(node, mutation_subject) }
6
4
 
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Matcher::Chain do
1
+ RSpec.describe Mutant::Matcher::Chain do
4
2
 
5
3
  let(:object) { described_class.new(matchers) }
6
4
 
@@ -0,0 +1,21 @@
1
+ RSpec.describe Mutant::Matcher::Compiler::SubjectPrefix do
2
+ let(:object) { described_class.new(Mutant::Expression.parse('Foo*')) }
3
+
4
+ let(:_subject) { double('Subject', expression: Mutant::Expression.parse(subject_expression)) }
5
+
6
+ describe '#call' do
7
+ subject { object.call(_subject) }
8
+
9
+ context 'when subject expression is prefixed by expression' do
10
+ let(:subject_expression) { 'Foo::Bar' }
11
+
12
+ it { should be(true) }
13
+ end
14
+
15
+ context 'when subject expression is NOT prefixed by expression' do
16
+ let(:subject_expression) { 'Bar' }
17
+
18
+ it { should be(false) }
19
+ end
20
+ end
21
+ end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Matcher::Compiler do
1
+ RSpec.describe Mutant::Matcher::Compiler do
4
2
  let(:object) { described_class }
5
3
 
6
4
  let(:env) { Fixtures::TEST_ENV }
@@ -82,6 +80,33 @@ describe Mutant::Matcher::Compiler do
82
80
 
83
81
  it { should eql(expected_matcher) }
84
82
  end
83
+
84
+ context 'and subject and attribute filter' do
85
+ let(:attributes) do
86
+ {
87
+ match_expressions: [expression_a],
88
+ subject_ignores: [expression_b],
89
+ subject_selects: [[:code, 'foo']]
90
+ }
91
+ end
92
+
93
+ let(:expected_positive_matcher) { Mutant::Matcher::Chain.new([matcher_a]) }
94
+
95
+ let(:expected_predicate) do
96
+ Morpher::Evaluator::Predicate::Boolean::And.new([
97
+ Morpher::Evaluator::Predicate::Boolean::Or.new([
98
+ Morpher.compile(s(:eql, s(:attribute, :code), s(:static, 'foo')))
99
+ ]),
100
+ Morpher::Evaluator::Predicate::Negation.new(
101
+ Morpher::Evaluator::Predicate::Boolean::Or.new([
102
+ described_class::SubjectPrefix.new(expression_b)
103
+ ])
104
+ )
105
+ ])
106
+ end
107
+
108
+ it { should eql(expected_matcher) }
109
+ end
85
110
  end
86
111
 
87
112
  context 'on config with multiple match expressions' do
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Matcher::Filter do
1
+ RSpec.describe Mutant::Matcher::Filter do
4
2
  let(:object) { described_class.new(matcher, predicate) }
5
3
 
6
4
  describe '#each' do
@@ -1,7 +1,5 @@
1
- require 'spec_helper'
2
-
3
1
  # rubocop:disable ClassAndModuleChildren
4
- describe Mutant::Matcher::Method::Instance do
2
+ RSpec.describe Mutant::Matcher::Method::Instance do
5
3
 
6
4
  let(:env) { Fixtures::TEST_ENV }
7
5
  let(:reporter) { Fixtures::TEST_CONFIG.reporter }
@@ -68,7 +66,7 @@ describe Mutant::Matcher::Method::Instance do
68
66
  end
69
67
 
70
68
  context 'when method is defined multiple times' do
71
- context 'on differend lines' do
69
+ context 'on different lines' do
72
70
  let(:base) { __LINE__ }
73
71
  class self::Foo
74
72
  def bar
@@ -96,7 +94,7 @@ describe Mutant::Matcher::Method::Instance do
96
94
  it_should_behave_like 'a method matcher'
97
95
  end
98
96
 
99
- context 'on the same line with differend scope' do
97
+ context 'on the same line with different scope' do
100
98
  let(:base) { __LINE__ }
101
99
  class self::Foo
102
100
  def self.bar; end; def bar(_arg); end
@@ -1,7 +1,5 @@
1
- require 'spec_helper'
2
-
3
1
  # rubocop:disable ClassAndModuleChildren
4
- describe Mutant::Matcher::Method::Singleton, '#each' do
2
+ RSpec.describe Mutant::Matcher::Method::Singleton, '#each' do
5
3
  subject { object.each { |subject| yields << subject } }
6
4
 
7
5
  let(:object) { described_class.new(env, scope, method) }
@@ -23,6 +21,26 @@ describe Mutant::Matcher::Method::Singleton, '#each' do
23
21
 
24
22
  context 'on singleton methods' do
25
23
 
24
+ context 'when also defined on lvar' do
25
+ let(:base) { __LINE__ }
26
+ class self::Foo
27
+ a = Object.new
28
+ def a.bar; end; def self.bar; end
29
+ end
30
+
31
+ let(:method_name) { :bar }
32
+ let(:method_line) { 3 }
33
+
34
+ it_should_behave_like 'a method matcher'
35
+
36
+ it 'warns about definition on non const/self' do
37
+ subject
38
+ expect(env.config.reporter.warn_calls).to(
39
+ include('Can only match :defs on :self or :const got :lvar unable to match')
40
+ )
41
+ end
42
+ end
43
+
26
44
  context 'when defined on self' do
27
45
  let(:base) { __LINE__ }
28
46
  class self::Foo
@@ -72,7 +90,7 @@ describe Mutant::Matcher::Method::Singleton, '#each' do
72
90
  end
73
91
 
74
92
  context 'when defined multiple times in the same line' do
75
- context 'with method on differend scope' do
93
+ context 'with method on different scope' do
76
94
  let(:base) { __LINE__ }
77
95
  module self::Namespace
78
96
  module Foo; end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Mutant::Matcher::Methods::Instance, '#each' do
1
+ RSpec.describe Mutant::Matcher::Methods::Instance, '#each' do
4
2
  let(:object) { described_class.new(env, Foo) }
5
3
  let(:env) { Fixtures::TEST_ENV }
6
4
 
@@ -46,9 +44,12 @@ describe Mutant::Matcher::Methods::Instance, '#each' do
46
44
 
47
45
  before do
48
46
  matcher = Mutant::Matcher::Method::Instance
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])
47
+ allow(matcher).to receive(:new)
48
+ .with(env, Foo, Foo.instance_method(:method_a)).and_return([subject_a])
49
+ allow(matcher).to receive(:new)
50
+ .with(env, Foo, Foo.instance_method(:method_b)).and_return([subject_b])
51
+ allow(matcher).to receive(:new)
52
+ .with(env, Foo, Foo.instance_method(:method_c)).and_return([subject_c])
52
53
  end
53
54
 
54
55
  it 'should yield expected subjects' do