mutest 0.0.6 → 0.0.7

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 (119) hide show
  1. checksums.yaml +4 -4
  2. data/.buildkite/hooks/pre-command +1 -1
  3. data/.buildkite/pipeline.yml +9 -22
  4. data/.gitmodules +3 -0
  5. data/CHANGELOG.md +14 -1
  6. data/Gemfile +11 -6
  7. data/Gemfile.lock +27 -101
  8. data/README.md +42 -2
  9. data/Rakefile +2 -8
  10. data/circle.yml +4 -1
  11. data/lib/mutest.rb +1 -1
  12. data/lib/mutest/ast/meta/send.rb +6 -0
  13. data/lib/mutest/ast/named_children.rb +1 -1
  14. data/lib/mutest/ast/nodes.rb +0 -2
  15. data/lib/mutest/ast/regexp.rb +4 -4
  16. data/lib/mutest/ast/regexp/transformer.rb +4 -4
  17. data/lib/mutest/ast/regexp/transformer/character_set.rb +1 -1
  18. data/lib/mutest/ast/regexp/transformer/direct.rb +1 -1
  19. data/lib/mutest/ast/regexp/transformer/quantifier.rb +3 -3
  20. data/lib/mutest/ast/regexp/transformer/recursive.rb +1 -1
  21. data/lib/mutest/ast/regexp/transformer/text.rb +1 -1
  22. data/lib/mutest/ast/types.rb +0 -1
  23. data/lib/mutest/cli.rb +1 -1
  24. data/lib/mutest/context.rb +1 -1
  25. data/lib/mutest/matcher/config.rb +0 -2
  26. data/lib/mutest/matcher/method.rb +1 -3
  27. data/lib/mutest/matcher/method/instance.rb +1 -1
  28. data/lib/mutest/matcher/methods.rb +1 -1
  29. data/lib/mutest/mutator.rb +0 -2
  30. data/lib/mutest/mutator/node/block_pass.rb +29 -0
  31. data/lib/mutest/mutator/node/generic.rb +1 -0
  32. data/lib/mutest/mutator/node/literal/boolean.rb +0 -1
  33. data/lib/mutest/mutator/node/literal/range.rb +1 -1
  34. data/lib/mutest/mutator/node/literal/regex.rb +1 -1
  35. data/lib/mutest/mutator/node/literal/string.rb +3 -0
  36. data/lib/mutest/mutator/node/literal/symbol.rb +0 -2
  37. data/lib/mutest/mutator/node/send.rb +35 -6
  38. data/lib/mutest/mutator/node/splat.rb +3 -1
  39. data/lib/mutest/parallel/worker.rb +1 -1
  40. data/lib/mutest/reporter/cli.rb +0 -2
  41. data/lib/mutest/reporter/cli/format.rb +1 -1
  42. data/lib/mutest/reporter/cli/printer.rb +2 -2
  43. data/lib/mutest/reporter/cli/printer/mutation_result.rb +0 -2
  44. data/lib/mutest/version.rb +1 -1
  45. data/meta/and.rb +0 -2
  46. data/meta/array.rb +0 -3
  47. data/meta/begin.rb +0 -3
  48. data/meta/block.rb +0 -1
  49. data/meta/block_pass.rb +30 -1
  50. data/meta/break.rb +0 -1
  51. data/meta/case.rb +0 -6
  52. data/meta/casgn.rb +0 -3
  53. data/meta/cvasgn.rb +0 -1
  54. data/meta/def.rb +0 -7
  55. data/meta/dstr.rb +2 -0
  56. data/meta/dsym.rb +2 -0
  57. data/meta/ensure.rb +0 -1
  58. data/meta/false.rb +0 -1
  59. data/meta/gvasgn.rb +0 -1
  60. data/meta/hash.rb +0 -4
  61. data/meta/if.rb +0 -5
  62. data/meta/ivasgn.rb +0 -1
  63. data/meta/kwbegin.rb +0 -1
  64. data/meta/lvasgn.rb +0 -1
  65. data/meta/match_current_line.rb +0 -1
  66. data/meta/next.rb +0 -1
  67. data/meta/or.rb +0 -2
  68. data/meta/regexp.rb +0 -1
  69. data/meta/rescue.rb +0 -6
  70. data/meta/send.rb +60 -16
  71. data/meta/splat.rb +25 -0
  72. data/meta/str.rb +1 -0
  73. data/meta/true.rb +0 -1
  74. data/meta/until.rb +0 -1
  75. data/meta/while.rb +0 -2
  76. data/meta/yield.rb +0 -1
  77. data/mutest-rspec.gemspec +1 -1
  78. data/mutest.gemspec +0 -4
  79. data/spec/integration/mutest/rspec_spec.rb +1 -1
  80. data/spec/integrations.yml +1 -1
  81. data/spec/shared/command_method_behavior.rb +5 -0
  82. data/spec/shared/idempotent_method_behavior.rb +10 -0
  83. data/spec/spec_helper.rb +21 -1
  84. data/spec/support/xspec.rb +1 -1
  85. data/spec/unit/mutest/actor/sender_spec.rb +1 -1
  86. data/spec/unit/mutest/ast/meta/send_spec.rb +23 -11
  87. data/spec/unit/mutest/cli_spec.rb +13 -13
  88. data/spec/unit/mutest/context_spec.rb +2 -2
  89. data/spec/unit/mutest/diff_spec.rb +9 -9
  90. data/spec/unit/mutest/integration/null_spec.rb +1 -1
  91. data/spec/unit/mutest/integration_spec.rb +1 -1
  92. data/spec/unit/mutest/matcher/method/instance_spec.rb +5 -5
  93. data/spec/unit/mutest/matcher/method/singleton_spec.rb +5 -5
  94. data/spec/unit/mutest/meta/example_spec.rb +3 -3
  95. data/spec/unit/mutest/mutation_spec.rb +5 -5
  96. data/spec/unit/mutest/mutator/node_spec.rb +6 -9
  97. data/spec/unit/mutest/parallel/driver_spec.rb +1 -1
  98. data/spec/unit/mutest/reporter/null_spec.rb +1 -1
  99. data/spec/unit/mutest/reporter/sequence_spec.rb +1 -1
  100. data/spec/unit/mutest/result_spec.rb +1 -1
  101. data/spec/unit/mutest/runner/sink_spec.rb +1 -1
  102. data/spec/unit/mutest/subject/method/instance/memoized_spec.rb +1 -1
  103. data/spec/unit/mutest/subject/method/instance_spec.rb +3 -3
  104. data/spec/unit/mutest/subject/method/singleton_spec.rb +3 -3
  105. data/spec/unit/mutest/subject_spec.rb +2 -2
  106. data/test_app/Gemfile.rspec3.6 +7 -0
  107. metadata +9 -57
  108. data/build/Dockerfile +0 -71
  109. data/build/docker-bootstrap.sh +0 -85
  110. data/build/docker-exec +0 -29
  111. data/build/make-docker +0 -3
  112. data/build/ruby_matrix +0 -1
  113. data/build/run +0 -5
  114. data/build/strict-mode.sh +0 -16
  115. data/config/devtools.yml +0 -2
  116. data/config/flay.yml +0 -3
  117. data/config/flog.yml +0 -2
  118. data/config/reek.yml +0 -137
  119. data/lib/mutest/mutator/node/noop.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97bf6ecfd043bbfd31dd3e8e2e5263261f0362f8
4
- data.tar.gz: 20eb837b1320b00cbaf394420b9cdb507fd8c06e
3
+ metadata.gz: accfe303b872672222caff0f1e8d6cf233120f48
4
+ data.tar.gz: a176ed5591646234e393215b9b2619c7bcc80661
5
5
  SHA512:
6
- metadata.gz: dbaf4594dfd3e4f6a5ed819475e0932794930084c46dab08e04471d1d88e0bcd3980a6ac1555c78d52455f34ac24cfd96961c4713d149380b3d1dab45a2ce79d
7
- data.tar.gz: 539337ea6d7cc082aeb3e9ee19e86afc9a26a6f2885e900d40ed3d0919800a071f16297ef8005d0374e4fce78156db060eaf5d4ee9606f9619e0c3ac83238724
6
+ metadata.gz: 229ddfaa29a990aeff3ad104a02fbcad1bad7bde6e52dfb66839bd65bc77d412349edc3158eaeb20b2f14aa186e61247045d417273cf4d674014d94078884469
7
+ data.tar.gz: 34f0cb733d977de967f79d106f2aa1ea19cca7d6038ace1ab5d23501331c0d1a2e00935ef825c2e7f759e2cecb0822d86697cd30ba4e361191e3a68ba60c4c72
@@ -1,3 +1,3 @@
1
1
  #!/bin/bash
2
2
 
3
- docker pull backus/mutest
3
+ docker pull backus/ruby-matrix
@@ -1,51 +1,38 @@
1
1
  steps:
2
- - command: "build/run 2.3.1 'rake metrics:coverage'"
2
+ - command: "build/run 2.3.3 'rspec spec/unit'"
3
3
  label: ":rspec: RSpec"
4
4
  agents:
5
5
  - queue=elastic
6
+ env:
7
+ COVERAGE: 'true'
6
8
 
7
9
  - name: ':rspec: Corpus tests (rubyspec)'
8
- command: build/run 2.3.1 'rspec --tag corpus:rubyspec'
10
+ command: build/run 2.3.3 'rspec --tag corpus:rubyspec'
9
11
  agents:
10
12
  - queue=elastic
11
13
 
12
14
  - name: ':rspec: Corpus tests (regexp_parser)'
13
- command: build/run 2.3.1 'rspec --tag corpus:regexp_parser'
15
+ command: build/run 2.3.3 'rspec --tag corpus:regexp_parser'
14
16
  agents:
15
17
  - queue=elastic
16
18
 
17
19
  - name: ':rspec: Corpus tests (axiom)'
18
- command: build/run 2.3.1 'rspec --tag corpus:axiom'
20
+ command: build/run 2.3.3 'rspec --tag corpus:axiom'
19
21
  agents:
20
22
  - queue=elastic
21
23
 
22
24
  - name: ':rspec: Integration tests'
23
- command: build/run 2.3.1 'rspec --exclude-pattern "**/corpus_spec.rb" --format documentation spec/integration'
25
+ command: build/run 2.3.3 'rspec --exclude-pattern "**/corpus_spec.rb" --format documentation spec/integration'
24
26
  agents:
25
27
  - queue=elastic
26
28
 
27
29
  - name: ':skull: Mutest'
28
- command: build/run 2.3.1 'rake metrics:mutant'
30
+ command: build/run 2.3.3 'rake metrics:mutest'
29
31
  timeout_in_minutes: 10
30
32
  agents:
31
33
  - queue=elastic
32
34
 
33
35
  - name: ':rubocop: Rubocop'
34
- command: build/run 2.3.1 'rake metrics:rubocop'
35
- agents:
36
- - queue=elastic
37
-
38
- - name: ':japanese_ogre: Flay'
39
- command: build/run 2.3.1 'rake metrics:flay'
40
- agents:
41
- - queue=elastic
42
-
43
- - name: ':imp: Flog'
44
- command: build/run 2.3.1 'rake metrics:flog'
45
- agents:
46
- - queue=elastic
47
-
48
- - name: ':hankey: Reek'
49
- command: build/run 2.3.1 'rake metrics:reek'
36
+ command: build/run 2.3.3 'rubocop --config config/rubocop.yml'
50
37
  agents:
51
38
  - queue=elastic
@@ -0,0 +1,3 @@
1
+ [submodule "build"]
2
+ path = build
3
+ url = https://github.com/backus/buildkite-ruby-matrix.git
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
6
6
 
7
7
  ## [Master (Unreleased)]
8
8
 
9
+ ## [0.0.7] - 2017-06-18
10
+
11
+ ### Added
12
+
13
+ - String literal mutations (`'foo'` -> `'foo__mutest__'`) [[#58](https://github.com/backus/mutest/pull/58/files) ([@dgollahon][])]
14
+ - Selector mutations for `[public_]method` methods (`foo.method(:to_s)` -> `foo.method(:to_str)`) [[#56](https://github.com/backus/mutest/pull/56/files) ([@dgollahon][])]
15
+ - Block-pass symbol#to_proc mutations (`foo(&:to_s)` -> `foo(&:to_str)`) [[#55](https://github.com/backus/mutest/pull/55/files) ([@dgollahon][])]
16
+ - Block-pass mutations (`foo(&method(:bar))` -> `foo(&public_method(:bar))`) [[#54](https://github.com/backus/mutest/pull/54/files) ([@dgollahon][])]
17
+
18
+ ### Removed
19
+ - Boolean to `nil` mutations (`true` -> `nil`; `false` -> `nil`) [[#42](https://github.com/backus/mutest/pull/42/files) ([@dgollahon][])]
20
+
9
21
  ## [0.0.6] - 2017-03-04
10
22
 
11
23
  ### Fixed
@@ -55,7 +67,8 @@ First proper RubyGems release
55
67
 
56
68
  <!-- Version diffs -->
57
69
 
58
- [Master (Unreleased)]: https://github.com/backus/mutest/compare/v0.0.6...HEAD
70
+ [Master (Unreleased)]: https://github.com/backus/mutest/compare/v0.0.7...HEAD
71
+ [0.0.7]: https://github.com/backus/mutest/compare/v0.0.6...v0.0.7
59
72
  [0.0.6]: https://github.com/backus/mutest/compare/v0.0.5...v0.0.6
60
73
  [0.0.5]: https://github.com/backus/mutest/compare/v0.0.4...v0.0.5
61
74
  [0.0.4]: https://github.com/backus/mutest/compare/v0.0.3...v0.0.4
data/Gemfile CHANGED
@@ -4,10 +4,15 @@ gemspec name: 'mutest'
4
4
 
5
5
  eval_gemfile File.expand_path('../Gemfile.shared', __FILE__)
6
6
 
7
- gem 'mutant', git: 'https://github.com/mbj/mutant.git'
7
+ gem 'pry', '~> 0.10'
8
+ gem 'pry-byebug', '~> 3.4'
9
+ gem 'rake', '~> 12'
10
+ gem 'rspec', '~> 3.6'
11
+ gem 'rspec-its', '~> 1.2.0'
12
+ gem 'rubocop', '~> 0.47.1'
13
+ gem 'rubocop-devtools', git: 'https://github.com/backus/rubocop-devtools.git'
14
+ gem 'rubocop-rspec', '~> 1.10.0'
15
+ gem 'simplecov', '~> 0.13.0'
8
16
 
9
- group :development do
10
- gem 'pry', '~> 0.10'
11
- gem 'pry-byebug', '~> 3.4'
12
- gem 'rubocop-devtools', git: 'https://github.com/backus/rubocop-devtools.git'
13
- end
17
+ # Lock to 1.10 in tests until https://git.io/vHjug is released
18
+ gem 'parallel', '= 1.10.0'
@@ -8,34 +8,10 @@ GIT
8
8
  concord (~> 0.1.5)
9
9
  ice_nine (~> 0.11.1)
10
10
 
11
- GIT
12
- remote: https://github.com/mbj/mutant.git
13
- revision: 24f6d42fa2b3d30fbf206169d08383972c803242
14
- specs:
15
- mutant (0.8.12)
16
- abstract_type (~> 0.0.7)
17
- adamantium (~> 0.2.0)
18
- anima (~> 0.3.0)
19
- ast (~> 2.2)
20
- concord (~> 0.1.5)
21
- diff-lcs (~> 1.2)
22
- equalizer (~> 0.0.9)
23
- ice_nine (~> 0.11.1)
24
- memoizable (~> 0.4.2)
25
- morpher (~> 0.2.6)
26
- parallel (~> 1.3)
27
- parser (~> 2.3.1, >= 2.3.1.4)
28
- procto (~> 0.0.2)
29
- regexp_parser (~> 0.4.1)
30
- unparser (~> 0.2.5)
31
- mutant-rspec (0.8.12)
32
- mutant (~> 0.8.12)
33
- rspec-core (>= 3.4.0, < 3.6.0)
34
-
35
11
  PATH
36
12
  remote: .
37
13
  specs:
38
- mutest (0.0.3)
14
+ mutest (0.0.7)
39
15
  abstract_type (~> 0.0.7)
40
16
  adamantium (~> 0.2.0)
41
17
  anima (~> 0.3.0)
@@ -64,54 +40,16 @@ GEM
64
40
  adamantium (~> 0.2)
65
41
  equalizer (~> 0.0.11)
66
42
  ast (2.3.0)
67
- axiom-types (0.1.1)
68
- descendants_tracker (~> 0.0.4)
69
- ice_nine (~> 0.11.0)
70
- thread_safe (~> 0.3, >= 0.3.1)
71
43
  byebug (9.0.6)
72
- codeclimate-engine-rb (0.4.0)
73
- virtus (~> 1.0)
74
44
  coderay (1.1.1)
75
- coercible (1.0.0)
76
- descendants_tracker (~> 0.0.1)
77
45
  concord (0.1.5)
78
46
  adamantium (~> 0.2.0)
79
47
  equalizer (~> 0.0.9)
80
- descendants_tracker (0.0.4)
81
- thread_safe (~> 0.3, >= 0.3.1)
82
- devtools (0.1.16)
83
- adamantium (~> 0.2.0)
84
- anima (~> 0.3.0)
85
- concord (~> 0.1.5)
86
- flay (~> 2.8.1)
87
- flog (~> 4.4.0)
88
- mutant (~> 0.8.11)
89
- mutant-rspec (~> 0.8.11)
90
- procto (~> 0.0.3)
91
- rake (~> 11.3.0)
92
- reek (~> 4.5.0)
93
- rspec (~> 3.5.0)
94
- rspec-core (~> 3.5.4)
95
- rspec-its (~> 1.2.0)
96
- rubocop (~> 0.47.0)
97
- simplecov (~> 0.12.0)
98
- yard (~> 0.9.1)
99
- yardstick (~> 0.9.9)
100
48
  diff-lcs (1.2.5)
101
49
  docile (1.1.5)
102
50
  equalizer (0.0.11)
103
- erubis (2.7.0)
104
- flay (2.8.1)
105
- erubis (~> 2.7.0)
106
- path_expander (~> 1.0)
107
- ruby_parser (~> 3.0)
108
- sexp_processor (~> 4.0)
109
- flog (4.4.1)
110
- path_expander (~> 1.0)
111
- ruby_parser (~> 3.1, > 3.1.0)
112
- sexp_processor (~> 4.4)
113
51
  ice_nine (0.11.2)
114
- json (2.0.3)
52
+ json (2.1.0)
115
53
  memoizable (0.4.2)
116
54
  thread_safe (~> 0.3, >= 0.3.1)
117
55
  method_source (0.8.2)
@@ -127,7 +65,6 @@ GEM
127
65
  parallel (1.10.0)
128
66
  parser (2.3.3.1)
129
67
  ast (~> 2.2)
130
- path_expander (1.0.1)
131
68
  powerpack (0.1.1)
132
69
  procto (0.0.3)
133
70
  pry (0.10.4)
@@ -137,29 +74,26 @@ GEM
137
74
  pry-byebug (3.4.2)
138
75
  byebug (~> 9.0)
139
76
  pry (~> 0.10)
140
- rainbow (2.2.1)
141
- rake (11.3.0)
142
- reek (4.5.4)
143
- codeclimate-engine-rb (~> 0.4.0)
144
- parser (~> 2.3.1, >= 2.3.1.2)
145
- rainbow (~> 2.0)
146
- regexp_parser (0.4.2)
147
- rspec (3.5.0)
148
- rspec-core (~> 3.5.0)
149
- rspec-expectations (~> 3.5.0)
150
- rspec-mocks (~> 3.5.0)
151
- rspec-core (3.5.4)
152
- rspec-support (~> 3.5.0)
153
- rspec-expectations (3.5.0)
77
+ rainbow (2.2.2)
78
+ rake
79
+ rake (12.0.0)
80
+ regexp_parser (0.4.3)
81
+ rspec (3.6.0)
82
+ rspec-core (~> 3.6.0)
83
+ rspec-expectations (~> 3.6.0)
84
+ rspec-mocks (~> 3.6.0)
85
+ rspec-core (3.6.0)
86
+ rspec-support (~> 3.6.0)
87
+ rspec-expectations (3.6.0)
154
88
  diff-lcs (>= 1.2.0, < 2.0)
155
- rspec-support (~> 3.5.0)
89
+ rspec-support (~> 3.6.0)
156
90
  rspec-its (1.2.0)
157
91
  rspec-core (>= 3.0.0)
158
92
  rspec-expectations (>= 3.0.0)
159
- rspec-mocks (3.5.0)
93
+ rspec-mocks (3.6.0)
160
94
  diff-lcs (>= 1.2.0, < 2.0)
161
- rspec-support (~> 3.5.0)
162
- rspec-support (3.5.0)
95
+ rspec-support (~> 3.6.0)
96
+ rspec-support (3.6.0)
163
97
  rubocop (0.47.1)
164
98
  parser (>= 2.3.3.1, < 3.0)
165
99
  powerpack (~> 0.1)
@@ -169,17 +103,14 @@ GEM
169
103
  rubocop-rspec (1.10.0)
170
104
  rubocop (>= 0.42.0)
171
105
  ruby-progressbar (1.8.1)
172
- ruby_parser (3.8.4)
173
- sexp_processor (~> 4.1)
174
- sexp_processor (4.7.0)
175
- simplecov (0.12.0)
106
+ simplecov (0.13.0)
176
107
  docile (~> 1.1.0)
177
108
  json (>= 1.8, < 3)
178
109
  simplecov-html (~> 0.10.0)
179
- simplecov-html (0.10.0)
110
+ simplecov-html (0.10.1)
180
111
  slop (3.6.0)
181
112
  thread_safe (0.3.5)
182
- unicode-display_width (1.1.3)
113
+ unicode-display_width (1.2.1)
183
114
  unparser (0.2.5)
184
115
  abstract_type (~> 0.0.7)
185
116
  adamantium (~> 0.2.0)
@@ -188,27 +119,22 @@ GEM
188
119
  equalizer (~> 0.0.9)
189
120
  parser (~> 2.3.0)
190
121
  procto (~> 0.0.2)
191
- virtus (1.0.5)
192
- axiom-types (~> 0.1)
193
- coercible (~> 1.0)
194
- descendants_tracker (~> 0.0, >= 0.0.3)
195
- equalizer (~> 0.0, >= 0.0.9)
196
- yard (0.9.8)
197
- yardstick (0.9.9)
198
- yard (~> 0.8, >= 0.8.7.2)
199
122
 
200
123
  PLATFORMS
201
124
  ruby
202
125
 
203
126
  DEPENDENCIES
204
- bundler (~> 1.10)
205
- devtools (~> 0.1.16)
206
- mutant!
207
127
  mutest!
128
+ parallel (= 1.10.0)
208
129
  pry (~> 0.10)
209
130
  pry-byebug (~> 3.4)
131
+ rake (~> 12)
132
+ rspec (~> 3.6)
133
+ rspec-its (~> 1.2.0)
134
+ rubocop (~> 0.47.1)
210
135
  rubocop-devtools!
211
136
  rubocop-rspec (~> 1.10.0)
137
+ simplecov (~> 0.13.0)
212
138
 
213
139
  BUNDLED WITH
214
- 1.14.3
140
+ 1.15.1
data/README.md CHANGED
@@ -1,7 +1,47 @@
1
1
  mutest
2
2
  ======
3
+ [![Build status](https://badge.buildkite.com/8b58446082c5724c4e37e7fa4a4e0d5ee04b936b95a744c3cf.svg?branch=master&style=flat-square)](https://buildkite.com/rubocop-rspec/mutest)
3
4
 
4
- This is a fork of a popular open source mutation testing tool for Ruby. Not ready for prime time!
5
+ `mutest` is a mutation testing tool for ruby designed to help audit the thoroughness of your test suite and encourage you to write more robust code.
6
+
7
+ ## How it works
8
+
9
+ `mutest` parses your ruby code, inserts modifications, and then runs your test suite. If your test suite still _passes_ after `mutest` has mutated your code, you have an _alive_ mutation--meaning your tests do not thoroughly cover the modified part of your code. If your tests _fail_ after the code has been modified, the mutation is _killed_. This means that your test suite was able to detect the semantic change and provide adequate coverage of that condition.
10
+
11
+ For full examples and a more detailed explanation of the technique, check out this [blog post](https://blog.blockscore.com/how-to-write-better-code-using-mutation-testing/).
12
+
13
+ ## Installation
14
+
15
+ `mutest` is currently only compatible with `rspec`. To install the `rspec` integration, run:
16
+
17
+ ```shell
18
+ $ gem install mutest-rspec
19
+ ```
20
+
21
+ or add
22
+
23
+ ```ruby
24
+ gem 'mutest-rspec'
25
+ ```
26
+
27
+ to your Gemfile.
28
+
29
+ ## Usage
30
+
31
+ ###### Run `mutest` on the entire MyProject namespace
32
+ `mutest --include lib --require my_project --use rspec 'MyProject*'`
33
+
34
+ ###### Run `mutest` on a specific class
35
+ `mutest --include lib --require my_project --use rspec 'MyProject::Foo'`
36
+
37
+ ###### Run `mutest` on a specific class method
38
+ `mutest --include lib --require my_project --use rspec 'MyProject::Foo.bar'`
39
+
40
+ ###### Run `mutest` on a specific instance method
41
+ `mutest --include lib --require my_project --use rspec 'MyProject::Foo#bar'`
42
+
43
+ ###### Run `mutest` on only the changes inside the MyProject namespace since a git revision
44
+ `mutest --include lib --require my_project --use rspec --since HEAD~1 'MyProject*'`
5
45
 
6
46
  ## Changes
7
47
 
@@ -9,4 +49,4 @@ For updates to the project, check out the [CHANGELOG](CHANGELOG.md)!
9
49
 
10
50
  ## Credit
11
51
 
12
- * Markus Schirp did an amazing job on [mutant](mbj/mutant) which this fork is based on.
52
+ * Markus Schirp did an amazing job on [mutant](https://github.com/mbj/mutant) which this fork is based on.
data/Rakefile CHANGED
@@ -1,12 +1,6 @@
1
- require 'devtools'
2
-
3
- Devtools.init_rake_tasks
4
-
5
- Rake.application.load_imports
6
-
7
- task('metrics:mutant').clear
1
+ desc 'Run mutest on itself'
8
2
  namespace :metrics do
9
- task mutant: :coverage do
3
+ task :mutest do
10
4
  arguments = %w[
11
5
  bundle exec mutest
12
6
  --include lib
data/circle.yml CHANGED
@@ -4,4 +4,7 @@ machine:
4
4
  version: '2.3.3'
5
5
  test:
6
6
  override:
7
- - bundle exec rake ci
7
+ - bundle exec rubocop --config config/rubocop.yml
8
+ - COVERAGE=true bundle exec rspec spec/unit
9
+ - bundle exec rspec spec/integration
10
+ - bundle exec rake metrics:mutest
@@ -123,7 +123,7 @@ require 'mutest/mutator/node/named_value/constant_assignment'
123
123
  require 'mutest/mutator/node/named_value/variable_assignment'
124
124
  require 'mutest/mutator/node/next'
125
125
  require 'mutest/mutator/node/break'
126
- require 'mutest/mutator/node/noop'
126
+ require 'mutest/mutator/node/block_pass'
127
127
  require 'mutest/mutator/node/or_asgn'
128
128
  require 'mutest/mutator/node/and_asgn'
129
129
  require 'mutest/mutator/node/defined'
@@ -12,6 +12,7 @@ module Mutest
12
12
 
13
13
  INDEX_ASSIGNMENT_SELECTOR = :[]=
14
14
  ATTRIBUTE_ASSIGNMENT_SELECTOR_SUFFIX = '='.freeze
15
+ METHOD_METHOD_SELECTORS = %i[method public_method].freeze
15
16
 
16
17
  # Arguments of mutated node
17
18
  #
@@ -65,6 +66,11 @@ module Mutest
65
66
  Const.new(receiver).possible_top_level?
66
67
  end
67
68
 
69
+ # Test if this is a selector that returns a method object
70
+ def method_object_selector?
71
+ METHOD_METHOD_SELECTORS.include?(selector)
72
+ end
73
+
68
74
  private
69
75
 
70
76
  # Test if node is `proc { ... }`
@@ -20,7 +20,7 @@ module Mutest
20
20
 
21
21
  # Mutated nodes children
22
22
  #
23
- # @return [Array<Parser::AST::Node]
23
+ # @return [Array<Parser::AST::Node>]
24
24
  def children
25
25
  node.children
26
26
  end