mutest 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildkite/hooks/pre-command +1 -1
- data/.buildkite/pipeline.yml +9 -22
- data/.gitmodules +3 -0
- data/CHANGELOG.md +14 -1
- data/Gemfile +11 -6
- data/Gemfile.lock +27 -101
- data/README.md +42 -2
- data/Rakefile +2 -8
- data/circle.yml +4 -1
- data/lib/mutest.rb +1 -1
- data/lib/mutest/ast/meta/send.rb +6 -0
- data/lib/mutest/ast/named_children.rb +1 -1
- data/lib/mutest/ast/nodes.rb +0 -2
- data/lib/mutest/ast/regexp.rb +4 -4
- data/lib/mutest/ast/regexp/transformer.rb +4 -4
- data/lib/mutest/ast/regexp/transformer/character_set.rb +1 -1
- data/lib/mutest/ast/regexp/transformer/direct.rb +1 -1
- data/lib/mutest/ast/regexp/transformer/quantifier.rb +3 -3
- data/lib/mutest/ast/regexp/transformer/recursive.rb +1 -1
- data/lib/mutest/ast/regexp/transformer/text.rb +1 -1
- data/lib/mutest/ast/types.rb +0 -1
- data/lib/mutest/cli.rb +1 -1
- data/lib/mutest/context.rb +1 -1
- data/lib/mutest/matcher/config.rb +0 -2
- data/lib/mutest/matcher/method.rb +1 -3
- data/lib/mutest/matcher/method/instance.rb +1 -1
- data/lib/mutest/matcher/methods.rb +1 -1
- data/lib/mutest/mutator.rb +0 -2
- data/lib/mutest/mutator/node/block_pass.rb +29 -0
- data/lib/mutest/mutator/node/generic.rb +1 -0
- data/lib/mutest/mutator/node/literal/boolean.rb +0 -1
- data/lib/mutest/mutator/node/literal/range.rb +1 -1
- data/lib/mutest/mutator/node/literal/regex.rb +1 -1
- data/lib/mutest/mutator/node/literal/string.rb +3 -0
- data/lib/mutest/mutator/node/literal/symbol.rb +0 -2
- data/lib/mutest/mutator/node/send.rb +35 -6
- data/lib/mutest/mutator/node/splat.rb +3 -1
- data/lib/mutest/parallel/worker.rb +1 -1
- data/lib/mutest/reporter/cli.rb +0 -2
- data/lib/mutest/reporter/cli/format.rb +1 -1
- data/lib/mutest/reporter/cli/printer.rb +2 -2
- data/lib/mutest/reporter/cli/printer/mutation_result.rb +0 -2
- data/lib/mutest/version.rb +1 -1
- data/meta/and.rb +0 -2
- data/meta/array.rb +0 -3
- data/meta/begin.rb +0 -3
- data/meta/block.rb +0 -1
- data/meta/block_pass.rb +30 -1
- data/meta/break.rb +0 -1
- data/meta/case.rb +0 -6
- data/meta/casgn.rb +0 -3
- data/meta/cvasgn.rb +0 -1
- data/meta/def.rb +0 -7
- data/meta/dstr.rb +2 -0
- data/meta/dsym.rb +2 -0
- data/meta/ensure.rb +0 -1
- data/meta/false.rb +0 -1
- data/meta/gvasgn.rb +0 -1
- data/meta/hash.rb +0 -4
- data/meta/if.rb +0 -5
- data/meta/ivasgn.rb +0 -1
- data/meta/kwbegin.rb +0 -1
- data/meta/lvasgn.rb +0 -1
- data/meta/match_current_line.rb +0 -1
- data/meta/next.rb +0 -1
- data/meta/or.rb +0 -2
- data/meta/regexp.rb +0 -1
- data/meta/rescue.rb +0 -6
- data/meta/send.rb +60 -16
- data/meta/splat.rb +25 -0
- data/meta/str.rb +1 -0
- data/meta/true.rb +0 -1
- data/meta/until.rb +0 -1
- data/meta/while.rb +0 -2
- data/meta/yield.rb +0 -1
- data/mutest-rspec.gemspec +1 -1
- data/mutest.gemspec +0 -4
- data/spec/integration/mutest/rspec_spec.rb +1 -1
- data/spec/integrations.yml +1 -1
- data/spec/shared/command_method_behavior.rb +5 -0
- data/spec/shared/idempotent_method_behavior.rb +10 -0
- data/spec/spec_helper.rb +21 -1
- data/spec/support/xspec.rb +1 -1
- data/spec/unit/mutest/actor/sender_spec.rb +1 -1
- data/spec/unit/mutest/ast/meta/send_spec.rb +23 -11
- data/spec/unit/mutest/cli_spec.rb +13 -13
- data/spec/unit/mutest/context_spec.rb +2 -2
- data/spec/unit/mutest/diff_spec.rb +9 -9
- data/spec/unit/mutest/integration/null_spec.rb +1 -1
- data/spec/unit/mutest/integration_spec.rb +1 -1
- data/spec/unit/mutest/matcher/method/instance_spec.rb +5 -5
- data/spec/unit/mutest/matcher/method/singleton_spec.rb +5 -5
- data/spec/unit/mutest/meta/example_spec.rb +3 -3
- data/spec/unit/mutest/mutation_spec.rb +5 -5
- data/spec/unit/mutest/mutator/node_spec.rb +6 -9
- data/spec/unit/mutest/parallel/driver_spec.rb +1 -1
- data/spec/unit/mutest/reporter/null_spec.rb +1 -1
- data/spec/unit/mutest/reporter/sequence_spec.rb +1 -1
- data/spec/unit/mutest/result_spec.rb +1 -1
- data/spec/unit/mutest/runner/sink_spec.rb +1 -1
- data/spec/unit/mutest/subject/method/instance/memoized_spec.rb +1 -1
- data/spec/unit/mutest/subject/method/instance_spec.rb +3 -3
- data/spec/unit/mutest/subject/method/singleton_spec.rb +3 -3
- data/spec/unit/mutest/subject_spec.rb +2 -2
- data/test_app/Gemfile.rspec3.6 +7 -0
- metadata +9 -57
- data/build/Dockerfile +0 -71
- data/build/docker-bootstrap.sh +0 -85
- data/build/docker-exec +0 -29
- data/build/make-docker +0 -3
- data/build/ruby_matrix +0 -1
- data/build/run +0 -5
- data/build/strict-mode.sh +0 -16
- data/config/devtools.yml +0 -2
- data/config/flay.yml +0 -3
- data/config/flog.yml +0 -2
- data/config/reek.yml +0 -137
- data/lib/mutest/mutator/node/noop.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: accfe303b872672222caff0f1e8d6cf233120f48
|
4
|
+
data.tar.gz: a176ed5591646234e393215b9b2619c7bcc80661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 229ddfaa29a990aeff3ad104a02fbcad1bad7bde6e52dfb66839bd65bc77d412349edc3158eaeb20b2f14aa186e61247045d417273cf4d674014d94078884469
|
7
|
+
data.tar.gz: 34f0cb733d977de967f79d106f2aa1ea19cca7d6038ace1ab5d23501331c0d1a2e00935ef825c2e7f759e2cecb0822d86697cd30ba4e361191e3a68ba60c4c72
|
data/.buildkite/pipeline.yml
CHANGED
@@ -1,51 +1,38 @@
|
|
1
1
|
steps:
|
2
|
-
- command: "build/run 2.3.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
data/.gitmodules
ADDED
data/CHANGELOG.md
CHANGED
@@ -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.
|
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 '
|
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
|
-
|
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'
|
data/Gemfile.lock
CHANGED
@@ -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.
|
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
|
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.
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
rspec-
|
150
|
-
|
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.
|
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.
|
93
|
+
rspec-mocks (3.6.0)
|
160
94
|
diff-lcs (>= 1.2.0, < 2.0)
|
161
|
-
rspec-support (~> 3.
|
162
|
-
rspec-support (3.
|
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
|
-
|
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.
|
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
|
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.
|
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
|
-
|
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
|
-
|
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
|
3
|
+
task :mutest do
|
10
4
|
arguments = %w[
|
11
5
|
bundle exec mutest
|
12
6
|
--include lib
|
data/circle.yml
CHANGED
data/lib/mutest.rb
CHANGED
@@ -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/
|
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'
|
data/lib/mutest/ast/meta/send.rb
CHANGED
@@ -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 { ... }`
|