mutant 0.3.0.rc1 → 0.3.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +0 -1
  3. data/.travis.yml +5 -4
  4. data/Gemfile.devtools +4 -4
  5. data/Guardfile +7 -5
  6. data/README.md +8 -8
  7. data/config/flay.yml +2 -2
  8. data/config/reek.yml +1 -0
  9. data/config/rubocop.yml +0 -4
  10. data/lib/mutant/cli/builder.rb +177 -0
  11. data/lib/mutant/cli/classifier/method.rb +10 -14
  12. data/lib/mutant/cli/classifier/namespace.rb +7 -9
  13. data/lib/mutant/cli/classifier.rb +29 -31
  14. data/lib/mutant/cli.rb +34 -96
  15. data/lib/mutant/color.rb +1 -1
  16. data/lib/mutant/config.rb +9 -3
  17. data/lib/mutant/constants.rb +1 -1
  18. data/lib/mutant/context/scope.rb +2 -2
  19. data/lib/mutant/differ.rb +0 -1
  20. data/lib/mutant/killer/rspec.rb +3 -8
  21. data/lib/mutant/killer.rb +1 -22
  22. data/lib/mutant/matcher/chain.rb +2 -2
  23. data/lib/mutant/matcher/filter.rb +32 -0
  24. data/lib/mutant/matcher/method/instance.rb +2 -2
  25. data/lib/mutant/matcher/method.rb +3 -3
  26. data/lib/mutant/matcher/methods.rb +1 -1
  27. data/lib/mutant/matcher.rb +1 -0
  28. data/lib/mutant/mutation/evil.rb +0 -10
  29. data/lib/mutant/mutation/neutral.rb +0 -23
  30. data/lib/mutant/mutation.rb +13 -23
  31. data/lib/mutant/mutator/node/begin.rb +12 -10
  32. data/lib/mutant/mutator/node/block.rb +1 -0
  33. data/lib/mutant/mutator/node/blockarg.rb +15 -0
  34. data/lib/mutant/mutator/node/case.rb +1 -0
  35. data/lib/mutant/mutator/node/connective/binary.rb +2 -2
  36. data/lib/mutant/mutator/node/const.rb +2 -1
  37. data/lib/mutant/mutator/node/dstr.rb +28 -0
  38. data/lib/mutant/mutator/node/dsym.rb +28 -0
  39. data/lib/mutant/mutator/node/generic.rb +3 -4
  40. data/lib/mutant/mutator/node/if.rb +1 -0
  41. data/lib/mutant/mutator/node/literal/boolean.rb +2 -2
  42. data/lib/mutant/mutator/node/literal/range.rb +8 -6
  43. data/lib/mutant/mutator/node/literal.rb +0 -17
  44. data/lib/mutant/mutator/node/masgn.rb +1 -1
  45. data/lib/mutant/mutator/node/named_value/variable_assignment.rb +5 -4
  46. data/lib/mutant/mutator/node/op_asgn.rb +30 -0
  47. data/lib/mutant/mutator/node/restarg.rb +15 -0
  48. data/lib/mutant/mutator/node/return.rb +1 -2
  49. data/lib/mutant/mutator/node/send.rb +6 -5
  50. data/lib/mutant/mutator/node/super.rb +1 -0
  51. data/lib/mutant/mutator/node/while.rb +1 -0
  52. data/lib/mutant/mutator/node.rb +11 -1
  53. data/lib/mutant/node_helpers.rb +3 -3
  54. data/lib/mutant/predicate/attribute.rb +85 -0
  55. data/lib/mutant/predicate/blacklist.rb +27 -0
  56. data/lib/mutant/predicate/matcher.rb +36 -0
  57. data/lib/mutant/predicate/whitelist.rb +28 -0
  58. data/lib/mutant/predicate.rb +91 -0
  59. data/lib/mutant/reporter/cli/printer/config.rb +3 -3
  60. data/lib/mutant/reporter/cli/printer/killer.rb +1 -1
  61. data/lib/mutant/reporter/cli/printer/mutation.rb +12 -14
  62. data/lib/mutant/reporter/cli/printer/subject.rb +1 -3
  63. data/lib/mutant/reporter/cli/printer.rb +31 -7
  64. data/lib/mutant/runner/mutation.rb +9 -1
  65. data/lib/mutant/runner/subject.rb +9 -1
  66. data/lib/mutant/runner.rb +5 -6
  67. data/lib/mutant/strategy/rspec.rb +4 -4
  68. data/lib/mutant/strategy.rb +2 -0
  69. data/lib/mutant/support/method_object.rb +0 -1
  70. data/lib/mutant/version.rb +1 -2
  71. data/lib/mutant/zombifier.rb +6 -3
  72. data/lib/mutant.rb +12 -4
  73. data/mutant.gemspec +7 -7
  74. data/spec/integration/mutant/rspec_spec.rb +12 -5
  75. data/spec/shared/mutator_behavior.rb +2 -1
  76. data/spec/spec_helper.rb +11 -9
  77. data/spec/unit/mutant/cli/builder/rspec_spec.rb +38 -0
  78. data/spec/unit/mutant/cli/classifier/{method/each_spec.rb → method_spec.rb} +2 -14
  79. data/spec/unit/mutant/cli/classifier/namespace/{flat/each_spec.rb → flat_spec.rb} +1 -1
  80. data/spec/unit/mutant/cli/classifier/namespace/{recursive/each_spec.rb → recursive_spec.rb} +1 -1
  81. data/spec/unit/mutant/cli/classifier_spec.rb +59 -0
  82. data/spec/unit/mutant/{cli/class_methods/new_spec.rb → cli_new_spec.rb} +22 -23
  83. data/spec/unit/mutant/{cli/class_methods/run_spec.rb → cli_run_spec.rb} +8 -8
  84. data/spec/unit/mutant/killer/rspec/class_methods/new_spec.rb +6 -6
  85. data/spec/unit/mutant/killer/success_predicate_spec.rb +5 -5
  86. data/spec/unit/mutant/loader/eval/class_methods/run_spec.rb +1 -1
  87. data/spec/unit/mutant/matcher/filter_spec.rb +19 -0
  88. data/spec/unit/mutant/matcher/namespace/each_spec.rb +5 -5
  89. data/spec/unit/mutant/mutation_spec.rb +42 -0
  90. data/spec/unit/mutant/mutator/each_spec.rb +1 -1
  91. data/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb +3 -2
  92. data/spec/unit/mutant/mutator/node/block/mutation_spec.rb +7 -2
  93. data/spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb +1 -0
  94. data/spec/unit/mutant/mutator/node/blockarg/mutation_spec.rb +17 -0
  95. data/spec/unit/mutant/mutator/node/case/mutation_spec.rb +5 -1
  96. data/spec/unit/mutant/mutator/node/cbase/mutation_spec.rb +1 -0
  97. data/spec/unit/mutant/mutator/node/const/mutation_spec.rb +3 -2
  98. data/spec/unit/mutant/mutator/node/define/mutation_spec.rb +3 -3
  99. data/spec/unit/mutant/mutator/node/defined_predicate/mutation_spec.rb +6 -2
  100. data/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb +4 -2
  101. data/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb +4 -2
  102. data/spec/unit/mutant/mutator/node/if/mutation_spec.rb +6 -1
  103. data/spec/unit/mutant/mutator/node/literal/fixnum_spec.rb +1 -1
  104. data/spec/unit/mutant/mutator/node/literal/float_spec.rb +1 -1
  105. data/spec/unit/mutant/mutator/node/literal/range_spec.rb +31 -0
  106. data/spec/unit/mutant/mutator/node/literal/regex_spec.rb +4 -2
  107. data/spec/unit/mutant/mutator/node/literal/string_spec.rb +1 -1
  108. data/spec/unit/mutant/mutator/node/literal/symbol_spec.rb +1 -1
  109. data/spec/unit/mutant/mutator/node/masgn/mutation_spec.rb +6 -2
  110. data/spec/unit/mutant/mutator/node/match_current_line/mutation_spec.rb +1 -0
  111. data/spec/unit/mutant/mutator/node/named_value/access/mutation_spec.rb +5 -1
  112. data/spec/unit/mutant/mutator/node/named_value/constant_assignment/mutation_spec.rb +1 -2
  113. data/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb +5 -5
  114. data/spec/unit/mutant/mutator/node/op_assgn/mutation_spec.rb +3 -2
  115. data/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb +3 -2
  116. data/spec/unit/mutant/mutator/node/rescue/mutation_spec.rb +1 -1
  117. data/spec/unit/mutant/mutator/node/restarg/mutation_spec.rb +3 -1
  118. data/spec/unit/mutant/mutator/node/return/mutation_spec.rb +7 -3
  119. data/spec/unit/mutant/mutator/node/send/mutation_spec.rb +37 -2
  120. data/spec/unit/mutant/mutator/node/super/mutation_spec.rb +4 -0
  121. data/spec/unit/mutant/mutator/node/while/mutation_spec.rb +3 -0
  122. data/spec/unit/mutant/predicate_spec.rb +135 -0
  123. data/spec/unit/mutant/runner/config/subjects_spec.rb +11 -11
  124. data/spec/unit/mutant/runner/config/success_predicate_spec.rb +6 -6
  125. data/spec/unit/mutant/runner/mutation/killer_spec.rb +11 -11
  126. data/spec/unit/mutant/runner/subject/success_predicate_spec.rb +9 -9
  127. data/spec/unit/mutant/strategy_spec.rb +21 -0
  128. data/spec/unit/mutant/subject_spec.rb +39 -0
  129. data/test_app/spec/shared/method_filter_parse_behavior.rb +1 -1
  130. metadata +54 -36
  131. data/lib/mutant/cli/classifier/scope.rb +0 -37
  132. data/lib/mutant/mutation/filter/code.rb +0 -49
  133. data/lib/mutant/mutation/filter/regexp.rb +0 -29
  134. data/lib/mutant/mutation/filter/whitelist.rb +0 -52
  135. data/lib/mutant/mutation/filter.rb +0 -78
  136. data/lib/mutant/strategy/static.rb +0 -20
  137. data/spec/unit/mutant/cli/classifier/class_methods/build_spec.rb +0 -48
  138. data/spec/unit/mutant/cli/classifier/scope/each_spec.rb +0 -33
@@ -10,26 +10,26 @@ describe Mutant::Runner::Subject, '#success?' do
10
10
  let(:mutation_subject) do
11
11
  double(
12
12
  'Subject',
13
- :class => Mutant::Subject,
14
- :mutations => [mutation_a, mutation_b]
13
+ class: Mutant::Subject,
14
+ mutations: [mutation_a, mutation_b]
15
15
  )
16
16
  end
17
17
 
18
- let(:reporter) { double('Reporter') }
19
- let(:config) { double('Config', :reporter => reporter) }
20
- let(:mutation_a) { double('Mutation A') }
21
- let(:mutation_b) { double('Mutation B') }
18
+ let(:reporter) { double('Reporter') }
19
+ let(:config) { double('Config', reporter: reporter) }
20
+ let(:mutation_a) { double('Mutation A') }
21
+ let(:mutation_b) { double('Mutation B') }
22
22
 
23
23
  let(:runner_a) do
24
- double('Runner A', :success? => success_a, :stop? => stop_a)
24
+ double('Runner A', success?: success_a, stop?: stop_a)
25
25
  end
26
26
 
27
27
  let(:runner_b) do
28
- double('Runner B', :success? => success_b, :stop? => stop_b)
28
+ double('Runner B', success?: success_b, stop?: stop_b)
29
29
  end
30
30
 
31
31
  before do
32
- reporter.stub(:report => reporter)
32
+ reporter.stub(report: reporter)
33
33
  Mutant::Runner.stub(:run).with(config, mutation_a).and_return(runner_a)
34
34
  Mutant::Runner.stub(:run).with(config, mutation_b).and_return(runner_b)
35
35
  end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Mutant::Strategy do
4
+
5
+ let(:class_under_test) do
6
+ Class.new(described_class)
7
+ end
8
+
9
+ let(:object) { class_under_test.new }
10
+
11
+ describe '#teardown' do
12
+ subject { object.teardown }
13
+ it_should_behave_like 'a command method'
14
+ end
15
+
16
+ describe '#setup' do
17
+ subject { object.setup }
18
+ it_should_behave_like 'a command method'
19
+ end
20
+ end
21
+
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ describe Mutant::Subject do
4
+ let(:class_under_test) do
5
+ Class.new(described_class) do
6
+ def match_expression
7
+ 'match'
8
+ end
9
+ end
10
+ end
11
+
12
+ let(:object) { class_under_test.new(context, node) }
13
+
14
+ let(:node) do
15
+ double('Node', location: location)
16
+ end
17
+
18
+ let(:location) do
19
+ double('Location', expression: expression)
20
+ end
21
+
22
+ let(:expression) do
23
+ double('Expression', line: 'source_line')
24
+ end
25
+
26
+ let(:context) do
27
+ double(
28
+ 'Context',
29
+ source_path: 'source_path',
30
+ source_line: 'source_line',
31
+ )
32
+ end
33
+
34
+ describe '#identification' do
35
+ subject { object.identification }
36
+
37
+ it { should eql('match:source_path:source_line') }
38
+ end
39
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  shared_examples_for 'a method filter parse result' do
4
4
  before do
5
- expected_class.stub(:new => response)
5
+ expected_class.stub(new: response)
6
6
  end
7
7
 
8
8
  let(:response) { double('Response') }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.rc1
4
+ version: 0.3.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-05 00:00:00.000000000 Z
11
+ date: 2013-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.0.pre6
19
+ version: 2.0.0.pre7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.0.pre6
26
+ version: 2.0.0.pre7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: unparser
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.14
33
+ version: 0.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.14
40
+ version: 0.1.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ice_nine
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 0.8.0
47
+ version: '0.8'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 0.8.0
54
+ version: '0.8'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: descendants_tracker
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: 0.0.10
75
+ version: 0.1.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: 0.0.10
82
+ version: 0.1.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: equalizer
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: 0.0.5
89
+ version: 0.0.7
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: 0.0.5
96
+ version: 0.0.7
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: inflecto
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 0.0.6
117
+ version: 0.1.1
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ~>
123
123
  - !ruby/object:Gem::Version
124
- version: 0.0.6
124
+ version: 0.1.1
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: concord
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ~>
130
130
  - !ruby/object:Gem::Version
131
- version: 0.1.3
131
+ version: 0.1.4
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ~>
137
137
  - !ruby/object:Gem::Version
138
- version: 0.1.3
138
+ version: 0.1.4
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -204,10 +204,10 @@ files:
204
204
  - lib/mutant.rb
205
205
  - lib/mutant/cache.rb
206
206
  - lib/mutant/cli.rb
207
+ - lib/mutant/cli/builder.rb
207
208
  - lib/mutant/cli/classifier.rb
208
209
  - lib/mutant/cli/classifier/method.rb
209
210
  - lib/mutant/cli/classifier/namespace.rb
210
- - lib/mutant/cli/classifier/scope.rb
211
211
  - lib/mutant/color.rb
212
212
  - lib/mutant/config.rb
213
213
  - lib/mutant/constants.rb
@@ -222,6 +222,7 @@ files:
222
222
  - lib/mutant/loader.rb
223
223
  - lib/mutant/matcher.rb
224
224
  - lib/mutant/matcher/chain.rb
225
+ - lib/mutant/matcher/filter.rb
225
226
  - lib/mutant/matcher/method.rb
226
227
  - lib/mutant/matcher/method/finder.rb
227
228
  - lib/mutant/matcher/method/instance.rb
@@ -231,10 +232,6 @@ files:
231
232
  - lib/mutant/matcher/scope.rb
232
233
  - lib/mutant/mutation.rb
233
234
  - lib/mutant/mutation/evil.rb
234
- - lib/mutant/mutation/filter.rb
235
- - lib/mutant/mutation/filter/code.rb
236
- - lib/mutant/mutation/filter/regexp.rb
237
- - lib/mutant/mutation/filter/whitelist.rb
238
235
  - lib/mutant/mutation/neutral.rb
239
236
  - lib/mutant/mutator.rb
240
237
  - lib/mutant/mutator/node.rb
@@ -242,10 +239,13 @@ files:
242
239
  - lib/mutant/mutator/node/arguments.rb
243
240
  - lib/mutant/mutator/node/begin.rb
244
241
  - lib/mutant/mutator/node/block.rb
242
+ - lib/mutant/mutator/node/blockarg.rb
245
243
  - lib/mutant/mutator/node/case.rb
246
244
  - lib/mutant/mutator/node/connective/binary.rb
247
245
  - lib/mutant/mutator/node/const.rb
248
246
  - lib/mutant/mutator/node/define.rb
247
+ - lib/mutant/mutator/node/dstr.rb
248
+ - lib/mutant/mutator/node/dsym.rb
249
249
  - lib/mutant/mutator/node/generic.rb
250
250
  - lib/mutant/mutator/node/if.rb
251
251
  - lib/mutant/mutator/node/literal.rb
@@ -267,6 +267,8 @@ files:
267
267
  - lib/mutant/mutator/node/named_value/variable_assignment.rb
268
268
  - lib/mutant/mutator/node/noop.rb
269
269
  - lib/mutant/mutator/node/nthref.rb
270
+ - lib/mutant/mutator/node/op_asgn.rb
271
+ - lib/mutant/mutator/node/restarg.rb
270
272
  - lib/mutant/mutator/node/return.rb
271
273
  - lib/mutant/mutator/node/send.rb
272
274
  - lib/mutant/mutator/node/send/binary.rb
@@ -280,6 +282,11 @@ files:
280
282
  - lib/mutant/mutator/util/array.rb
281
283
  - lib/mutant/mutator/util/symbol.rb
282
284
  - lib/mutant/node_helpers.rb
285
+ - lib/mutant/predicate.rb
286
+ - lib/mutant/predicate/attribute.rb
287
+ - lib/mutant/predicate/blacklist.rb
288
+ - lib/mutant/predicate/matcher.rb
289
+ - lib/mutant/predicate/whitelist.rb
283
290
  - lib/mutant/random.rb
284
291
  - lib/mutant/reporter.rb
285
292
  - lib/mutant/reporter/cli.rb
@@ -296,7 +303,6 @@ files:
296
303
  - lib/mutant/singleton_methods.rb
297
304
  - lib/mutant/strategy.rb
298
305
  - lib/mutant/strategy/rspec.rb
299
- - lib/mutant/strategy/static.rb
300
306
  - lib/mutant/subject.rb
301
307
  - lib/mutant/subject/method.rb
302
308
  - lib/mutant/subject/method/instance.rb
@@ -317,13 +323,13 @@ files:
317
323
  - spec/support/rspec.rb
318
324
  - spec/support/test_app.rb
319
325
  - spec/unit/mutant/class_methods/singleton_subclass_instance_spec.rb
320
- - spec/unit/mutant/cli/class_methods/new_spec.rb
321
- - spec/unit/mutant/cli/class_methods/run_spec.rb
322
- - spec/unit/mutant/cli/classifier/class_methods/build_spec.rb
323
- - spec/unit/mutant/cli/classifier/method/each_spec.rb
324
- - spec/unit/mutant/cli/classifier/namespace/flat/each_spec.rb
325
- - spec/unit/mutant/cli/classifier/namespace/recursive/each_spec.rb
326
- - spec/unit/mutant/cli/classifier/scope/each_spec.rb
326
+ - spec/unit/mutant/cli/builder/rspec_spec.rb
327
+ - spec/unit/mutant/cli/classifier/method_spec.rb
328
+ - spec/unit/mutant/cli/classifier/namespace/flat_spec.rb
329
+ - spec/unit/mutant/cli/classifier/namespace/recursive_spec.rb
330
+ - spec/unit/mutant/cli/classifier_spec.rb
331
+ - spec/unit/mutant/cli_new_spec.rb
332
+ - spec/unit/mutant/cli_run_spec.rb
327
333
  - spec/unit/mutant/context/root_spec.rb
328
334
  - spec/unit/mutant/context/scope/root_spec.rb
329
335
  - spec/unit/mutant/context/scope/unqualified_name_spec.rb
@@ -336,12 +342,14 @@ files:
336
342
  - spec/unit/mutant/matcher/chain/each_spec.rb
337
343
  - spec/unit/mutant/matcher/chain/matchers_spec.rb
338
344
  - spec/unit/mutant/matcher/each_spec.rb
345
+ - spec/unit/mutant/matcher/filter_spec.rb
339
346
  - spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
340
347
  - spec/unit/mutant/matcher/method/instance/each_spec.rb
341
348
  - spec/unit/mutant/matcher/method/singleton/each_spec.rb
342
349
  - spec/unit/mutant/matcher/methods/instance/each_spec.rb
343
350
  - spec/unit/mutant/matcher/methods/singleton/each_spec.rb
344
351
  - spec/unit/mutant/matcher/namespace/each_spec.rb
352
+ - spec/unit/mutant/mutation_spec.rb
345
353
  - spec/unit/mutant/mutator/each_spec.rb
346
354
  - spec/unit/mutant/mutator/emit_new_spec.rb
347
355
  - spec/unit/mutant/mutator/emit_spec.rb
@@ -349,6 +357,7 @@ files:
349
357
  - spec/unit/mutant/mutator/node/begin/mutation_spec.rb
350
358
  - spec/unit/mutant/mutator/node/block/mutation_spec.rb
351
359
  - spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb
360
+ - spec/unit/mutant/mutator/node/blockarg/mutation_spec.rb
352
361
  - spec/unit/mutant/mutator/node/break/mutation_spec.rb
353
362
  - spec/unit/mutant/mutator/node/case/mutation_spec.rb
354
363
  - spec/unit/mutant/mutator/node/cbase/mutation_spec.rb
@@ -388,13 +397,16 @@ files:
388
397
  - spec/unit/mutant/mutator/node/while/mutation_spec.rb
389
398
  - spec/unit/mutant/mutator/node/yield/mutation_spec.rb
390
399
  - spec/unit/mutant/node_helpers/n_not_spec.rb
400
+ - spec/unit/mutant/predicate_spec.rb
391
401
  - spec/unit/mutant/runner/config/subjects_spec.rb
392
402
  - spec/unit/mutant/runner/config/success_predicate_spec.rb
393
403
  - spec/unit/mutant/runner/mutation/killer_spec.rb
394
404
  - spec/unit/mutant/runner/subject/success_predicate_spec.rb
405
+ - spec/unit/mutant/strategy_spec.rb
395
406
  - spec/unit/mutant/subject/context_spec.rb
396
407
  - spec/unit/mutant/subject/mutations_spec.rb
397
408
  - spec/unit/mutant/subject/node_spec.rb
409
+ - spec/unit/mutant/subject_spec.rb
398
410
  - test_app/.rspec
399
411
  - test_app/lib/test_app.rb
400
412
  - test_app/lib/test_app/literal.rb
@@ -437,13 +449,13 @@ test_files:
437
449
  - spec/integration/mutant/test_mutator_handles_types_spec.rb
438
450
  - spec/integration/mutant/zombie_spec.rb
439
451
  - spec/unit/mutant/class_methods/singleton_subclass_instance_spec.rb
440
- - spec/unit/mutant/cli/class_methods/new_spec.rb
441
- - spec/unit/mutant/cli/class_methods/run_spec.rb
442
- - spec/unit/mutant/cli/classifier/class_methods/build_spec.rb
443
- - spec/unit/mutant/cli/classifier/method/each_spec.rb
444
- - spec/unit/mutant/cli/classifier/namespace/flat/each_spec.rb
445
- - spec/unit/mutant/cli/classifier/namespace/recursive/each_spec.rb
446
- - spec/unit/mutant/cli/classifier/scope/each_spec.rb
452
+ - spec/unit/mutant/cli/builder/rspec_spec.rb
453
+ - spec/unit/mutant/cli/classifier/method_spec.rb
454
+ - spec/unit/mutant/cli/classifier/namespace/flat_spec.rb
455
+ - spec/unit/mutant/cli/classifier/namespace/recursive_spec.rb
456
+ - spec/unit/mutant/cli/classifier_spec.rb
457
+ - spec/unit/mutant/cli_new_spec.rb
458
+ - spec/unit/mutant/cli_run_spec.rb
447
459
  - spec/unit/mutant/context/root_spec.rb
448
460
  - spec/unit/mutant/context/scope/root_spec.rb
449
461
  - spec/unit/mutant/context/scope/unqualified_name_spec.rb
@@ -456,12 +468,14 @@ test_files:
456
468
  - spec/unit/mutant/matcher/chain/each_spec.rb
457
469
  - spec/unit/mutant/matcher/chain/matchers_spec.rb
458
470
  - spec/unit/mutant/matcher/each_spec.rb
471
+ - spec/unit/mutant/matcher/filter_spec.rb
459
472
  - spec/unit/mutant/matcher/method/instance/class_methods/build_spec.rb
460
473
  - spec/unit/mutant/matcher/method/instance/each_spec.rb
461
474
  - spec/unit/mutant/matcher/method/singleton/each_spec.rb
462
475
  - spec/unit/mutant/matcher/methods/instance/each_spec.rb
463
476
  - spec/unit/mutant/matcher/methods/singleton/each_spec.rb
464
477
  - spec/unit/mutant/matcher/namespace/each_spec.rb
478
+ - spec/unit/mutant/mutation_spec.rb
465
479
  - spec/unit/mutant/mutator/each_spec.rb
466
480
  - spec/unit/mutant/mutator/emit_new_spec.rb
467
481
  - spec/unit/mutant/mutator/emit_spec.rb
@@ -469,6 +483,7 @@ test_files:
469
483
  - spec/unit/mutant/mutator/node/begin/mutation_spec.rb
470
484
  - spec/unit/mutant/mutator/node/block/mutation_spec.rb
471
485
  - spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb
486
+ - spec/unit/mutant/mutator/node/blockarg/mutation_spec.rb
472
487
  - spec/unit/mutant/mutator/node/break/mutation_spec.rb
473
488
  - spec/unit/mutant/mutator/node/case/mutation_spec.rb
474
489
  - spec/unit/mutant/mutator/node/cbase/mutation_spec.rb
@@ -508,11 +523,14 @@ test_files:
508
523
  - spec/unit/mutant/mutator/node/while/mutation_spec.rb
509
524
  - spec/unit/mutant/mutator/node/yield/mutation_spec.rb
510
525
  - spec/unit/mutant/node_helpers/n_not_spec.rb
526
+ - spec/unit/mutant/predicate_spec.rb
511
527
  - spec/unit/mutant/runner/config/subjects_spec.rb
512
528
  - spec/unit/mutant/runner/config/success_predicate_spec.rb
513
529
  - spec/unit/mutant/runner/mutation/killer_spec.rb
514
530
  - spec/unit/mutant/runner/subject/success_predicate_spec.rb
531
+ - spec/unit/mutant/strategy_spec.rb
515
532
  - spec/unit/mutant/subject/context_spec.rb
516
533
  - spec/unit/mutant/subject/mutations_spec.rb
517
534
  - spec/unit/mutant/subject/node_spec.rb
535
+ - spec/unit/mutant/subject_spec.rb
518
536
  has_rdoc:
@@ -1,37 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Mutant
4
- class CLI
5
- class Classifier
6
-
7
- # Scope classifier
8
- class Scope < self
9
-
10
- REGEXP = /\A(#{SCOPE_PATTERN})\z/.freeze
11
-
12
- private
13
-
14
- # Return matcher
15
- #
16
- # @return [Matcher]
17
- #
18
- # @api private
19
- #
20
- def matcher
21
- Matcher::Scope.new(scope)
22
- end
23
-
24
- # Return namespace
25
- #
26
- # @return [Class, Module]
27
- #
28
- # @api private
29
- #
30
- def scope
31
- Classifier.constant_lookup(match[1].to_s)
32
- end
33
-
34
- end # Scope
35
- end # Classifier
36
- end # CLI
37
- end # Mutant
@@ -1,49 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Mutant
4
- class Mutation
5
- class Filter
6
- # Mutation filter that filters on mutation codes
7
- class Code < self
8
- include Concord::Public.new(:code)
9
-
10
- # Test for match
11
- #
12
- # @param [Mutation] mutation
13
- #
14
- # @return [true]
15
- # returns true if mutation code matches filter code
16
- #
17
- # @return [false]
18
- # returns false otherwise
19
- #
20
- # @api private
21
- #
22
- def match?(mutation)
23
- mutation.code.eql?(code)
24
- end
25
-
26
- PATTERN = /\Acode:([a-f0-9]{1,6})\z/.freeze
27
-
28
- # Test if class handles string
29
- #
30
- # @param [String] notation
31
- #
32
- # @return [Filter]
33
- # return code filter instance if notation matches pattern
34
- #
35
- # @return [nil]
36
- # returns nil otherwise
37
- #
38
- # @api private
39
- #
40
- def self.handle(notation)
41
- match = PATTERN.match(notation)
42
- return unless match
43
- new(match[1])
44
- end
45
-
46
- end # Code
47
- end # Filter
48
- end # Mutation
49
- end # Mutant
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Mutant
4
- class Mutation
5
- class Filter
6
- # Mutaiton filter filtering in regexp match on mutation identification
7
- class Regexp < self
8
- include Concord::Public.new(:regexp)
9
-
10
- # Test for match
11
- #
12
- # @param [Mutation] mutation
13
- #
14
- # @return [true]
15
- # returns true if mutation identification is matched by regexp
16
- #
17
- # @return [false]
18
- # returns false otherwise
19
- #
20
- # @api private
21
- #
22
- def match?(mutation)
23
- !!(regexp =~ mutation.identification)
24
- end
25
-
26
- end # Regexp
27
- end # Filter
28
- end # Mutation
29
- end # Mutant
@@ -1,52 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Mutant
4
- class Mutation
5
- class Filter
6
-
7
- # Whiltelist filter
8
- class Whitelist < self
9
- include Adamantium::Flat, Equalizer.new(:whitelist)
10
-
11
- # Test for match
12
- #
13
- # @param [Mutation] mutation
14
- #
15
- # @return [true]
16
- # returns true if mutation matches whitelist
17
- #
18
- # @return [false]
19
- # returns false otherwise
20
- #
21
- # @api private
22
- #
23
- def match?(mutation)
24
- @whitelist.any? { |filter| filter.match?(mutation) }
25
- end
26
-
27
- # Return whitelist
28
- #
29
- # @return [Enumerable<Filter>]
30
- #
31
- # @api private
32
- #
33
- attr_reader :whitelist
34
-
35
- private
36
-
37
- # Initalize white list
38
- #
39
- # @param [Enumerable<Filter>] whitelist
40
- #
41
- # @return [undefined]
42
- #
43
- # @api private
44
- #
45
- def initialize(whitelist)
46
- @whitelist = whitelist
47
- end
48
-
49
- end # Whitelist
50
- end # Filter
51
- end # Mutation
52
- end # Mutant
@@ -1,78 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Mutant
4
- class Mutation
5
- # Abstract filter for mutations
6
- class Filter
7
- include Adamantium::Flat, AbstractType
8
- extend DescendantsTracker
9
-
10
- # Check for match
11
- #
12
- # @param [Mutation] mutation
13
- #
14
- # @return [true]
15
- # returns true if mutation is matched by filter
16
- #
17
- # @return [false]
18
- # returns false otherwise
19
- #
20
- # @api private
21
- #
22
- abstract_method :match?
23
-
24
- # Build filter from string
25
- #
26
- # @param [String] notation
27
- #
28
- # @return [Filter]
29
- # returns filter when can be buld from string
30
- #
31
- # @return [nil]
32
- # returns nil otherwise
33
- #
34
- # @api private
35
- #
36
- def self.build(notation)
37
- descendants.each do |descendant|
38
- filter = descendant.handle(notation)
39
- return filter if filter
40
- end
41
-
42
- nil
43
- end
44
-
45
- # Return filter for handle
46
- #
47
- # @param [String] _notation
48
- #
49
- # @return [nil]
50
- # returns nil
51
- #
52
- # @api private
53
- #
54
- def self.handle(_notation)
55
- nil
56
- end
57
-
58
- # Mutation filter matching all mutations
59
- Mutant.singleton_subclass_instance('ALL', self) do
60
-
61
- # Test for match
62
- #
63
- # @pram [Mutation] _mutation
64
- #
65
- # @return [true]
66
- # returns true
67
- #
68
- # @api private
69
- #
70
- def match?(_mutation)
71
- true
72
- end
73
-
74
- end
75
-
76
- end # Filter
77
- end # Mutation
78
- end # Mutant