mutant 0.9.3 → 0.9.8
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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +121 -0
- data/Changelog.md +24 -0
- data/Gemfile +0 -15
- data/Gemfile.lock +56 -59
- data/Gemfile.shared +7 -0
- data/LICENSE +1 -1
- data/README.md +10 -1
- data/config/rubocop.yml +10 -3
- data/docs/commercial-support.md +14 -0
- data/lib/mutant.rb +4 -2
- data/lib/mutant/cli.rb +5 -5
- data/lib/mutant/integration.rb +1 -1
- data/lib/mutant/license.rb +2 -2
- data/lib/mutant/license/subscription/opensource.rb +1 -1
- data/lib/mutant/meta.rb +1 -3
- data/lib/mutant/meta/example/verification.rb +1 -1
- data/lib/mutant/mutator/node/generic.rb +0 -48
- data/lib/mutant/mutator/node/send.rb +1 -1
- data/lib/mutant/parallel.rb +1 -1
- data/lib/mutant/registry.rb +2 -7
- data/lib/mutant/reporter/cli/format.rb +1 -1
- data/lib/mutant/transform.rb +6 -5
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant/zombifier.rb +2 -0
- data/mutant.gemspec +15 -13
- data/spec/integrations.yml +3 -1
- data/spec/support/corpus.rb +3 -3
- data/spec/support/ruby_vm.rb +1 -2
- data/spec/support/shared_context.rb +3 -3
- data/spec/support/xspec.rb +2 -2
- data/spec/unit/mutant/license_spec.rb +2 -2
- data/spec/unit/mutant/parallel/driver_spec.rb +4 -4
- data/spec/unit/mutant/parallel/worker_spec.rb +5 -5
- data/spec/unit/mutant/parallel_spec.rb +7 -7
- data/spec/unit/mutant/registry_spec.rb +52 -25
- data/spec/unit/mutant/repository/diff/ranges_spec.rb +2 -2
- metadata +44 -23
- data/.circleci/config.yml +0 -53
- data/lib/mutant/base.rb +0 -192
- data/lib/mutant/variable.rb +0 -282
- data/spec/unit/mutant/either_spec.rb +0 -247
- data/spec/unit/mutant/maybe_spec.rb +0 -60
- data/spec/unit/mutant/variable_spec.rb +0 -618
@@ -16,15 +16,15 @@ RSpec.describe Mutant::Parallel::Driver do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
let(:var_active_jobs) do
|
19
|
-
instance_double(
|
19
|
+
instance_double(Variable::IVar, 'active jobs')
|
20
20
|
end
|
21
21
|
|
22
22
|
let(:var_final) do
|
23
|
-
instance_double(
|
23
|
+
instance_double(Variable::IVar, 'final')
|
24
24
|
end
|
25
25
|
|
26
26
|
let(:var_sink) do
|
27
|
-
instance_double(
|
27
|
+
instance_double(Variable::IVar, 'sink')
|
28
28
|
end
|
29
29
|
|
30
30
|
subject do
|
@@ -64,7 +64,7 @@ RSpec.describe Mutant::Parallel::Driver do
|
|
64
64
|
receiver: var_final,
|
65
65
|
selector: :take_timeout,
|
66
66
|
arguments: [timeout],
|
67
|
-
reaction: { return:
|
67
|
+
reaction: { return: Variable.const_get(:Result)::Timeout.new }
|
68
68
|
},
|
69
69
|
{
|
70
70
|
receiver: var_active_jobs,
|
@@ -31,23 +31,23 @@ RSpec.describe Mutant::Parallel::Worker do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
let(:var_active_jobs) do
|
34
|
-
instance_double(
|
34
|
+
instance_double(Variable::IVar, 'active jobs')
|
35
35
|
end
|
36
36
|
|
37
37
|
let(:var_final) do
|
38
|
-
instance_double(
|
38
|
+
instance_double(Variable::IVar, 'final')
|
39
39
|
end
|
40
40
|
|
41
41
|
let(:var_running) do
|
42
|
-
instance_double(
|
42
|
+
instance_double(Variable::MVar, 'running')
|
43
43
|
end
|
44
44
|
|
45
45
|
let(:var_sink) do
|
46
|
-
instance_double(
|
46
|
+
instance_double(Variable::IVar, 'sink')
|
47
47
|
end
|
48
48
|
|
49
49
|
let(:var_source) do
|
50
|
-
instance_double(
|
50
|
+
instance_double(Variable::IVar, 'source')
|
51
51
|
end
|
52
52
|
|
53
53
|
subject do
|
@@ -30,28 +30,28 @@ RSpec.describe Mutant::Parallel do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
let(:var_active_jobs) do
|
33
|
-
instance_double(
|
33
|
+
instance_double(Variable::IVar, 'active jobs')
|
34
34
|
end
|
35
35
|
|
36
36
|
let(:var_final) do
|
37
|
-
instance_double(
|
37
|
+
instance_double(Variable::IVar, 'final')
|
38
38
|
end
|
39
39
|
|
40
40
|
let(:var_running) do
|
41
|
-
instance_double(
|
41
|
+
instance_double(Variable::MVar, 'running')
|
42
42
|
end
|
43
43
|
|
44
44
|
let(:var_sink) do
|
45
|
-
instance_double(
|
45
|
+
instance_double(Variable::IVar, 'sink')
|
46
46
|
end
|
47
47
|
|
48
48
|
let(:var_source) do
|
49
|
-
instance_double(
|
49
|
+
instance_double(Variable::IVar, 'source')
|
50
50
|
end
|
51
51
|
|
52
52
|
def ivar(value, **attributes)
|
53
53
|
{
|
54
|
-
receiver:
|
54
|
+
receiver: Variable::IVar,
|
55
55
|
selector: :new,
|
56
56
|
arguments: [
|
57
57
|
condition_variable: condition_variable,
|
@@ -63,7 +63,7 @@ RSpec.describe Mutant::Parallel do
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def mvar(*arguments)
|
66
|
-
ivar(*arguments).merge(receiver:
|
66
|
+
ivar(*arguments).merge(receiver: Variable::MVar)
|
67
67
|
end
|
68
68
|
|
69
69
|
let(:raw_expectations) do
|
@@ -1,47 +1,74 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.describe Mutant::Registry do
|
4
|
-
let(:lookup) { object.lookup(type) }
|
5
|
-
let(:object) { described_class.new }
|
6
4
|
let(:mutator) { class_double(Mutant::Mutator) }
|
5
|
+
let(:object) { described_class.new }
|
7
6
|
|
8
|
-
|
9
|
-
object.
|
10
|
-
end
|
11
|
-
|
12
|
-
context 'on registered type' do
|
13
|
-
subject { register_mutator }
|
7
|
+
describe '#lookup' do
|
8
|
+
subject { object.lookup(type) }
|
14
9
|
|
15
|
-
|
10
|
+
def register
|
11
|
+
object.register(type, mutator)
|
12
|
+
end
|
16
13
|
|
17
|
-
|
14
|
+
context 'on known type' do
|
15
|
+
let(:type) { :true }
|
18
16
|
|
19
|
-
|
20
|
-
|
17
|
+
it 'returns registered' do
|
18
|
+
register
|
19
|
+
expect(subject).to be(mutator)
|
20
|
+
end
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
context 'on unknown type' do
|
24
|
+
let(:type) { :unknown }
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
expect { register_mutator }.to raise_error(described_class::RegistryError, 'Duplicate type registration: :true')
|
26
|
+
it 'returns genericm mutator' do
|
27
|
+
expect(subject).to be(Mutant::Mutator::Node::Generic)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
describe '#register' do
|
33
|
+
subject { object.register(type, mutator) }
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
def lookup
|
36
|
+
subject.lookup(type)
|
37
37
|
end
|
38
|
-
end
|
39
38
|
|
40
|
-
|
41
|
-
|
39
|
+
context 'on registered type' do
|
40
|
+
let(:type) { :true }
|
41
|
+
|
42
|
+
it_behaves_like 'a command method'
|
42
43
|
|
43
|
-
|
44
|
-
|
44
|
+
it 'allows to lookup the mutator' do
|
45
|
+
subject
|
46
|
+
expect(lookup).to be(mutator)
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'when registering twice' do
|
50
|
+
it 'fails upon registration' do
|
51
|
+
object.register(type, mutator)
|
52
|
+
|
53
|
+
expect { subject }
|
54
|
+
.to raise_error(
|
55
|
+
described_class::RegistryError,
|
56
|
+
'Duplicate type registration: :true'
|
57
|
+
)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
context 'when registering an invalid node type' do
|
63
|
+
let(:type) { :invalid }
|
64
|
+
|
65
|
+
it 'raises error' do
|
66
|
+
expect { subject }
|
67
|
+
.to raise_error(
|
68
|
+
described_class::RegistryError,
|
69
|
+
'Invalid type registration: :invalid'
|
70
|
+
)
|
71
|
+
end
|
45
72
|
end
|
46
73
|
end
|
47
74
|
end
|
@@ -13,7 +13,7 @@ describe Mutant::Repository::Diff::Ranges do
|
|
13
13
|
Tempfile.open('new') do |new_file|
|
14
14
|
new_file.write(new)
|
15
15
|
new_file.flush
|
16
|
-
# rubocop:disable Lint/
|
16
|
+
# rubocop:disable Lint/RedundantSplatExpansion
|
17
17
|
stdout, status = Open3.capture2(
|
18
18
|
*%W[
|
19
19
|
git
|
@@ -25,7 +25,7 @@ describe Mutant::Repository::Diff::Ranges do
|
|
25
25
|
#{new_file.path}
|
26
26
|
]
|
27
27
|
)
|
28
|
-
# rubocop:enable Lint/
|
28
|
+
# rubocop:enable Lint/RedundantSplatExpansion
|
29
29
|
|
30
30
|
fail unless [0, 256].include?(status.to_i)
|
31
31
|
|
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.9.
|
4
|
+
version: 0.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: abstract_type
|
@@ -84,14 +84,14 @@ dependencies:
|
|
84
84
|
name: diff-lcs
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.3'
|
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
96
|
version: '1.3'
|
97
97
|
- !ruby/object:Gem::Dependency
|
@@ -136,20 +136,34 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 0.4.2
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: mprelude
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.1.0
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.1.0
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: parser
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
157
|
- - "~>"
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: 2.
|
159
|
+
version: 2.7.1
|
146
160
|
type: :runtime
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: 2.
|
166
|
+
version: 2.7.1
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: procto
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,28 +184,42 @@ dependencies:
|
|
170
184
|
requirements:
|
171
185
|
- - "~>"
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.4.
|
187
|
+
version: 0.4.6
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 0.4.6
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: variable
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: 0.0.1
|
174
202
|
type: :runtime
|
175
203
|
prerelease: false
|
176
204
|
version_requirements: !ruby/object:Gem::Requirement
|
177
205
|
requirements:
|
178
206
|
- - "~>"
|
179
207
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.
|
208
|
+
version: 0.0.1
|
181
209
|
- !ruby/object:Gem::Dependency
|
182
210
|
name: devtools
|
183
211
|
requirement: !ruby/object:Gem::Requirement
|
184
212
|
requirements:
|
185
213
|
- - "~>"
|
186
214
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0.1.
|
215
|
+
version: 0.1.25
|
188
216
|
type: :development
|
189
217
|
prerelease: false
|
190
218
|
version_requirements: !ruby/object:Gem::Requirement
|
191
219
|
requirements:
|
192
220
|
- - "~>"
|
193
221
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0.1.
|
222
|
+
version: 0.1.25
|
195
223
|
- !ruby/object:Gem::Dependency
|
196
224
|
name: parallel
|
197
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -215,7 +243,7 @@ extensions: []
|
|
215
243
|
extra_rdoc_files:
|
216
244
|
- LICENSE
|
217
245
|
files:
|
218
|
-
- ".
|
246
|
+
- ".github/workflows/ci.yml"
|
219
247
|
- ".gitignore"
|
220
248
|
- ".rspec"
|
221
249
|
- ".rubocop.yml"
|
@@ -231,6 +259,7 @@ files:
|
|
231
259
|
- config/reek.yml
|
232
260
|
- config/rubocop.yml
|
233
261
|
- config/yardstick.yml
|
262
|
+
- docs/commercial-support.md
|
234
263
|
- docs/concurrency.md
|
235
264
|
- docs/incremental.md
|
236
265
|
- docs/known-problems.md
|
@@ -252,7 +281,6 @@ files:
|
|
252
281
|
- lib/mutant/ast/nodes.rb
|
253
282
|
- lib/mutant/ast/sexp.rb
|
254
283
|
- lib/mutant/ast/types.rb
|
255
|
-
- lib/mutant/base.rb
|
256
284
|
- lib/mutant/bootstrap.rb
|
257
285
|
- lib/mutant/cli.rb
|
258
286
|
- lib/mutant/color.rb
|
@@ -395,7 +423,6 @@ files:
|
|
395
423
|
- lib/mutant/timer.rb
|
396
424
|
- lib/mutant/transform.rb
|
397
425
|
- lib/mutant/util.rb
|
398
|
-
- lib/mutant/variable.rb
|
399
426
|
- lib/mutant/version.rb
|
400
427
|
- lib/mutant/warnings.rb
|
401
428
|
- lib/mutant/zombifier.rb
|
@@ -499,7 +526,6 @@ files:
|
|
499
526
|
- spec/unit/mutant/config_spec.rb
|
500
527
|
- spec/unit/mutant/context_spec.rb
|
501
528
|
- spec/unit/mutant/diff_spec.rb
|
502
|
-
- spec/unit/mutant/either_spec.rb
|
503
529
|
- spec/unit/mutant/env_spec.rb
|
504
530
|
- spec/unit/mutant/expression/method_spec.rb
|
505
531
|
- spec/unit/mutant/expression/methods_spec.rb
|
@@ -527,7 +553,6 @@ files:
|
|
527
553
|
- spec/unit/mutant/matcher/scope_spec.rb
|
528
554
|
- spec/unit/mutant/matcher/static_spec.rb
|
529
555
|
- spec/unit/mutant/matcher_spec.rb
|
530
|
-
- spec/unit/mutant/maybe_spec.rb
|
531
556
|
- spec/unit/mutant/meta/example/dsl_spec.rb
|
532
557
|
- spec/unit/mutant/meta/example/verification_spec.rb
|
533
558
|
- spec/unit/mutant/meta/example_spec.rb
|
@@ -582,7 +607,6 @@ files:
|
|
582
607
|
- spec/unit/mutant/transform/primitive_spec.rb
|
583
608
|
- spec/unit/mutant/transform/sequence_spec.rb
|
584
609
|
- spec/unit/mutant/util/one_spec.rb
|
585
|
-
- spec/unit/mutant/variable_spec.rb
|
586
610
|
- spec/unit/mutant/warnings_spec.rb
|
587
611
|
- spec/unit/mutant/world_spec.rb
|
588
612
|
- spec/unit/mutant/zombifier_spec.rb
|
@@ -598,7 +622,7 @@ homepage: https://github.com/mbj/mutant
|
|
598
622
|
licenses:
|
599
623
|
- Nonstandard
|
600
624
|
metadata: {}
|
601
|
-
post_install_message:
|
625
|
+
post_install_message:
|
602
626
|
rdoc_options: []
|
603
627
|
require_paths:
|
604
628
|
- lib
|
@@ -613,8 +637,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
613
637
|
- !ruby/object:Gem::Version
|
614
638
|
version: '0'
|
615
639
|
requirements: []
|
616
|
-
rubygems_version: 3.
|
617
|
-
signing_key:
|
640
|
+
rubygems_version: 3.1.2
|
641
|
+
signing_key:
|
618
642
|
specification_version: 4
|
619
643
|
summary: ''
|
620
644
|
test_files:
|
@@ -637,7 +661,6 @@ test_files:
|
|
637
661
|
- spec/unit/mutant/config_spec.rb
|
638
662
|
- spec/unit/mutant/context_spec.rb
|
639
663
|
- spec/unit/mutant/diff_spec.rb
|
640
|
-
- spec/unit/mutant/either_spec.rb
|
641
664
|
- spec/unit/mutant/env_spec.rb
|
642
665
|
- spec/unit/mutant/expression/method_spec.rb
|
643
666
|
- spec/unit/mutant/expression/methods_spec.rb
|
@@ -665,7 +688,6 @@ test_files:
|
|
665
688
|
- spec/unit/mutant/matcher/scope_spec.rb
|
666
689
|
- spec/unit/mutant/matcher/static_spec.rb
|
667
690
|
- spec/unit/mutant/matcher_spec.rb
|
668
|
-
- spec/unit/mutant/maybe_spec.rb
|
669
691
|
- spec/unit/mutant/meta/example/dsl_spec.rb
|
670
692
|
- spec/unit/mutant/meta/example/verification_spec.rb
|
671
693
|
- spec/unit/mutant/meta/example_spec.rb
|
@@ -720,7 +742,6 @@ test_files:
|
|
720
742
|
- spec/unit/mutant/transform/primitive_spec.rb
|
721
743
|
- spec/unit/mutant/transform/sequence_spec.rb
|
722
744
|
- spec/unit/mutant/util/one_spec.rb
|
723
|
-
- spec/unit/mutant/variable_spec.rb
|
724
745
|
- spec/unit/mutant/warnings_spec.rb
|
725
746
|
- spec/unit/mutant/world_spec.rb
|
726
747
|
- spec/unit/mutant/zombifier_spec.rb
|
data/.circleci/config.yml
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
defaults: &defaults
|
2
|
-
working_directory: ~/mutant
|
3
|
-
docker:
|
4
|
-
- image: circleci/ruby:2.6.0
|
5
|
-
version: 2
|
6
|
-
jobs:
|
7
|
-
unit_specs:
|
8
|
-
<<: *defaults
|
9
|
-
steps:
|
10
|
-
- checkout
|
11
|
-
- run: bundle install
|
12
|
-
- run: bundle exec rspec spec/unit spec/integration/mutant/test_mutator_handles_types_spec.rb
|
13
|
-
integration_minitest:
|
14
|
-
<<: *defaults
|
15
|
-
steps:
|
16
|
-
- checkout
|
17
|
-
- run: bundle install
|
18
|
-
- run: bundle exec rspec spec/integration -e minitest
|
19
|
-
integration_rspec:
|
20
|
-
<<: *defaults
|
21
|
-
steps:
|
22
|
-
- checkout
|
23
|
-
- run: bundle install
|
24
|
-
- run: bundle exec rspec spec/integration -e rspec
|
25
|
-
integration_mutation_generation:
|
26
|
-
<<: *defaults
|
27
|
-
steps:
|
28
|
-
- checkout
|
29
|
-
- run: bundle install
|
30
|
-
- run: bundle exec rspec spec/integration -e generation
|
31
|
-
metrics:
|
32
|
-
<<: *defaults
|
33
|
-
steps:
|
34
|
-
- checkout
|
35
|
-
- run: bundle install
|
36
|
-
- run: bundle exec rake metrics:rubocop
|
37
|
-
- run: bundle exec rake metrics:reek
|
38
|
-
mutant:
|
39
|
-
<<: *defaults
|
40
|
-
steps:
|
41
|
-
- checkout
|
42
|
-
- run: bundle install
|
43
|
-
- run: bundle exec mutant --jobs 4 --since HEAD~1 --zombie -- 'Mutant*'
|
44
|
-
workflows:
|
45
|
-
version: 2
|
46
|
-
test:
|
47
|
-
jobs:
|
48
|
-
- unit_specs
|
49
|
-
- integration_rspec
|
50
|
-
- integration_minitest
|
51
|
-
- integration_mutation_generation
|
52
|
-
- metrics
|
53
|
-
- mutant
|