mutant 0.9.2 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +26 -0
  3. data/Gemfile +0 -8
  4. data/Gemfile.lock +55 -59
  5. data/LICENSE +1 -1
  6. data/README.md +9 -0
  7. data/config/rubocop.yml +10 -3
  8. data/docs/commercial-support.md +14 -0
  9. data/lib/mutant.rb +5 -4
  10. data/lib/mutant/cli.rb +5 -5
  11. data/lib/mutant/config.rb +1 -0
  12. data/lib/mutant/integration.rb +1 -1
  13. data/lib/mutant/license.rb +33 -6
  14. data/lib/mutant/license/subscription/opensource.rb +1 -1
  15. data/lib/mutant/meta.rb +1 -3
  16. data/lib/mutant/meta/example/verification.rb +1 -1
  17. data/lib/mutant/mutator/node/generic.rb +25 -2
  18. data/lib/mutant/mutator/node/send.rb +1 -1
  19. data/lib/mutant/parallel.rb +1 -1
  20. data/lib/mutant/reporter/cli/format.rb +1 -1
  21. data/lib/mutant/transform.rb +6 -5
  22. data/lib/mutant/version.rb +1 -1
  23. data/lib/mutant/warnings.rb +1 -1
  24. data/lib/mutant/zombifier.rb +2 -0
  25. data/mutant.gemspec +17 -16
  26. data/spec/integrations.yml +3 -1
  27. data/spec/support/corpus.rb +3 -3
  28. data/spec/support/ruby_vm.rb +1 -2
  29. data/spec/support/shared_context.rb +3 -3
  30. data/spec/support/xspec.rb +2 -2
  31. data/spec/unit/mutant/license_spec.rb +43 -7
  32. data/spec/unit/mutant/parallel/driver_spec.rb +4 -4
  33. data/spec/unit/mutant/parallel/worker_spec.rb +5 -5
  34. data/spec/unit/mutant/parallel_spec.rb +7 -7
  35. data/spec/unit/mutant/repository/diff/ranges_spec.rb +2 -2
  36. metadata +31 -24
  37. data/lib/mutant/base.rb +0 -192
  38. data/lib/mutant/variable.rb +0 -282
  39. data/spec/unit/mutant/either_spec.rb +0 -247
  40. data/spec/unit/mutant/maybe_spec.rb +0 -60
  41. data/spec/unit/mutant/variable_spec.rb +0 -618
@@ -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(Mutant::Variable::IVar, 'active jobs')
34
+ instance_double(Variable::IVar, 'active jobs')
35
35
  end
36
36
 
37
37
  let(:var_final) do
38
- instance_double(Mutant::Variable::IVar, 'final')
38
+ instance_double(Variable::IVar, 'final')
39
39
  end
40
40
 
41
41
  let(:var_running) do
42
- instance_double(Mutant::Variable::MVar, 'running')
42
+ instance_double(Variable::MVar, 'running')
43
43
  end
44
44
 
45
45
  let(:var_sink) do
46
- instance_double(Mutant::Variable::IVar, 'sink')
46
+ instance_double(Variable::IVar, 'sink')
47
47
  end
48
48
 
49
49
  let(:var_source) do
50
- instance_double(Mutant::Variable::IVar, 'source')
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(Mutant::Variable::IVar, 'active jobs')
33
+ instance_double(Variable::IVar, 'active jobs')
34
34
  end
35
35
 
36
36
  let(:var_final) do
37
- instance_double(Mutant::Variable::IVar, 'final')
37
+ instance_double(Variable::IVar, 'final')
38
38
  end
39
39
 
40
40
  let(:var_running) do
41
- instance_double(Mutant::Variable::MVar, 'running')
41
+ instance_double(Variable::MVar, 'running')
42
42
  end
43
43
 
44
44
  let(:var_sink) do
45
- instance_double(Mutant::Variable::IVar, 'sink')
45
+ instance_double(Variable::IVar, 'sink')
46
46
  end
47
47
 
48
48
  let(:var_source) do
49
- instance_double(Mutant::Variable::IVar, 'source')
49
+ instance_double(Variable::IVar, 'source')
50
50
  end
51
51
 
52
52
  def ivar(value, **attributes)
53
53
  {
54
- receiver: Mutant::Variable::IVar,
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: Mutant::Variable::MVar)
66
+ ivar(*arguments).merge(receiver: Variable::MVar)
67
67
  end
68
68
 
69
69
  let(:raw_expectations) do
@@ -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/UnneededSplatExpansion
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/UnneededSplatExpansion
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.2
4
+ version: 0.9.7
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-01-02 00:00:00.000000000 Z
11
+ date: 2020-07-22 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
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.4.2
139
139
  - !ruby/object:Gem::Dependency
140
- name: mutant-license
140
+ name: mprelude
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 2.6.5
159
+ version: 2.7.1
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 2.6.5
166
+ version: 2.7.1
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: procto
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -184,28 +184,42 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.4.5
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
188
202
  type: :runtime
189
203
  prerelease: false
190
204
  version_requirements: !ruby/object:Gem::Requirement
191
205
  requirements:
192
206
  - - "~>"
193
207
  - !ruby/object:Gem::Version
194
- version: 0.4.5
208
+ version: 0.0.1
195
209
  - !ruby/object:Gem::Dependency
196
210
  name: devtools
197
211
  requirement: !ruby/object:Gem::Requirement
198
212
  requirements:
199
213
  - - "~>"
200
214
  - !ruby/object:Gem::Version
201
- version: 0.1.23
215
+ version: 0.1.25
202
216
  type: :development
203
217
  prerelease: false
204
218
  version_requirements: !ruby/object:Gem::Requirement
205
219
  requirements:
206
220
  - - "~>"
207
221
  - !ruby/object:Gem::Version
208
- version: 0.1.23
222
+ version: 0.1.25
209
223
  - !ruby/object:Gem::Dependency
210
224
  name: parallel
211
225
  requirement: !ruby/object:Gem::Requirement
@@ -220,7 +234,7 @@ dependencies:
220
234
  - - "~>"
221
235
  - !ruby/object:Gem::Version
222
236
  version: '1.3'
223
- description: Mutation testing for ruby
237
+ description: Mutation Testing for Ruby.
224
238
  email:
225
239
  - mbj@schirp-dso.com
226
240
  executables:
@@ -245,6 +259,7 @@ files:
245
259
  - config/reek.yml
246
260
  - config/rubocop.yml
247
261
  - config/yardstick.yml
262
+ - docs/commercial-support.md
248
263
  - docs/concurrency.md
249
264
  - docs/incremental.md
250
265
  - docs/known-problems.md
@@ -266,7 +281,6 @@ files:
266
281
  - lib/mutant/ast/nodes.rb
267
282
  - lib/mutant/ast/sexp.rb
268
283
  - lib/mutant/ast/types.rb
269
- - lib/mutant/base.rb
270
284
  - lib/mutant/bootstrap.rb
271
285
  - lib/mutant/cli.rb
272
286
  - lib/mutant/color.rb
@@ -409,7 +423,6 @@ files:
409
423
  - lib/mutant/timer.rb
410
424
  - lib/mutant/transform.rb
411
425
  - lib/mutant/util.rb
412
- - lib/mutant/variable.rb
413
426
  - lib/mutant/version.rb
414
427
  - lib/mutant/warnings.rb
415
428
  - lib/mutant/zombifier.rb
@@ -513,7 +526,6 @@ files:
513
526
  - spec/unit/mutant/config_spec.rb
514
527
  - spec/unit/mutant/context_spec.rb
515
528
  - spec/unit/mutant/diff_spec.rb
516
- - spec/unit/mutant/either_spec.rb
517
529
  - spec/unit/mutant/env_spec.rb
518
530
  - spec/unit/mutant/expression/method_spec.rb
519
531
  - spec/unit/mutant/expression/methods_spec.rb
@@ -541,7 +553,6 @@ files:
541
553
  - spec/unit/mutant/matcher/scope_spec.rb
542
554
  - spec/unit/mutant/matcher/static_spec.rb
543
555
  - spec/unit/mutant/matcher_spec.rb
544
- - spec/unit/mutant/maybe_spec.rb
545
556
  - spec/unit/mutant/meta/example/dsl_spec.rb
546
557
  - spec/unit/mutant/meta/example/verification_spec.rb
547
558
  - spec/unit/mutant/meta/example_spec.rb
@@ -596,7 +607,6 @@ files:
596
607
  - spec/unit/mutant/transform/primitive_spec.rb
597
608
  - spec/unit/mutant/transform/sequence_spec.rb
598
609
  - spec/unit/mutant/util/one_spec.rb
599
- - spec/unit/mutant/variable_spec.rb
600
610
  - spec/unit/mutant/warnings_spec.rb
601
611
  - spec/unit/mutant/world_spec.rb
602
612
  - spec/unit/mutant/zombifier_spec.rb
@@ -612,7 +622,7 @@ homepage: https://github.com/mbj/mutant
612
622
  licenses:
613
623
  - Nonstandard
614
624
  metadata: {}
615
- post_install_message:
625
+ post_install_message:
616
626
  rdoc_options: []
617
627
  require_paths:
618
628
  - lib
@@ -628,9 +638,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
628
638
  version: '0'
629
639
  requirements: []
630
640
  rubygems_version: 3.0.3
631
- signing_key:
641
+ signing_key:
632
642
  specification_version: 4
633
- summary: Mutation testing tool for ruby under MRI and Rubinius
643
+ summary: ''
634
644
  test_files:
635
645
  - spec/integration/mutant/corpus_spec.rb
636
646
  - spec/integration/mutant/isolation/fork_spec.rb
@@ -651,7 +661,6 @@ test_files:
651
661
  - spec/unit/mutant/config_spec.rb
652
662
  - spec/unit/mutant/context_spec.rb
653
663
  - spec/unit/mutant/diff_spec.rb
654
- - spec/unit/mutant/either_spec.rb
655
664
  - spec/unit/mutant/env_spec.rb
656
665
  - spec/unit/mutant/expression/method_spec.rb
657
666
  - spec/unit/mutant/expression/methods_spec.rb
@@ -679,7 +688,6 @@ test_files:
679
688
  - spec/unit/mutant/matcher/scope_spec.rb
680
689
  - spec/unit/mutant/matcher/static_spec.rb
681
690
  - spec/unit/mutant/matcher_spec.rb
682
- - spec/unit/mutant/maybe_spec.rb
683
691
  - spec/unit/mutant/meta/example/dsl_spec.rb
684
692
  - spec/unit/mutant/meta/example/verification_spec.rb
685
693
  - spec/unit/mutant/meta/example_spec.rb
@@ -734,7 +742,6 @@ test_files:
734
742
  - spec/unit/mutant/transform/primitive_spec.rb
735
743
  - spec/unit/mutant/transform/sequence_spec.rb
736
744
  - spec/unit/mutant/util/one_spec.rb
737
- - spec/unit/mutant/variable_spec.rb
738
745
  - spec/unit/mutant/warnings_spec.rb
739
746
  - spec/unit/mutant/world_spec.rb
740
747
  - spec/unit/mutant/zombifier_spec.rb
@@ -1,192 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mutant
4
- module Functor
5
- include AbstractType
6
-
7
- abstract_method :fmap
8
-
9
- private
10
-
11
- # Raise error unless block is provided
12
- #
13
- # @raise [MissingBlockError]
14
- # if no block is given
15
- #
16
- # @return [self]
17
- def require_block
18
- fail LocalJumpError unless block_given?
19
- self
20
- end
21
- end # Functor
22
-
23
- class Maybe
24
- include(
25
- AbstractType,
26
- Adamantium::Flat,
27
- Functor
28
- )
29
-
30
- class Nothing < self
31
- instance = new
32
-
33
- define_method(:new) { instance }
34
-
35
- # Evaluate functor block
36
- #
37
- # @return [Maybe::Nothing]
38
- def fmap(&block)
39
- require_block(&block)
40
- end
41
-
42
- # Evaluate applicative block
43
- #
44
- # @return [Maybe::Nothing]
45
- def apply(&block)
46
- require_block(&block)
47
- end
48
- end # Nothing
49
-
50
- class Just < self
51
- include Concord.new(:value)
52
-
53
- # Evalute functor block
54
- #
55
- # @return [Maybe::Just<Object>]
56
- def fmap
57
- Just.new(yield(value))
58
- end
59
-
60
- # Evalute applicative block
61
- #
62
- # @return [Maybe]
63
- def apply
64
- yield(value)
65
- end
66
- end # Just
67
- end # Maybe
68
-
69
- class Either
70
- include(
71
- AbstractType,
72
- Adamantium::Flat,
73
- Concord.new(:value),
74
- Functor
75
- )
76
-
77
- # Execute block and wrap error in left
78
- #
79
- # @param [Class:Exception] error
80
- #
81
- # @return [Either<Exception, Object>]
82
- def self.wrap_error(error)
83
- Right.new(yield)
84
- rescue error => exception
85
- Left.new(exception)
86
- end
87
-
88
- class Left < self
89
- # Evaluate functor block
90
- #
91
- # @return [Either::Left<Object>]
92
- def fmap(&block)
93
- require_block(&block)
94
- end
95
-
96
- # Evaluate applicative block
97
- #
98
- # @return [Either::Left<Object>]
99
- def apply(&block)
100
- require_block(&block)
101
- end
102
-
103
- # Unwrap value from left
104
- #
105
- # @return [Object]
106
- def from_left
107
- value
108
- end
109
-
110
- # Unwrap value from right
111
- #
112
- # @return [Object]
113
- #
114
- # rubocop:disable Style/GuardClause
115
- def from_right
116
- if block_given?
117
- yield(value)
118
- else
119
- fail "Expected right value, got #{inspect}"
120
- end
121
- end
122
- # rubocop:enable Style/GuardClause
123
-
124
- # Map over left value
125
- #
126
- # @return [Either::Right<Object>]
127
- def lmap
128
- Left.new(yield(value))
129
- end
130
-
131
- # Evaluate left side of branch
132
- #
133
- # @param [#call] left
134
- # @param [#call] _right
135
- def either(left, _right)
136
- left.call(value)
137
- end
138
- end # Left
139
-
140
- class Right < self
141
- # Evaluate functor block
142
- #
143
- # @return [Either::Right<Object>]
144
- def fmap
145
- Right.new(yield(value))
146
- end
147
-
148
- # Evaluate applicative block
149
- #
150
- # @return [Either<Object>]
151
- def apply
152
- yield(value)
153
- end
154
-
155
- # Unwrap value from left
156
- #
157
- # @return [Object]
158
- #
159
- # rubocop:disable Style/GuardClause
160
- def from_left
161
- if block_given?
162
- yield(value)
163
- else
164
- fail "Expected left value, got #{inspect}"
165
- end
166
- end
167
- # rubocop:enable Style/GuardClause
168
-
169
- # Unwrap value from right
170
- #
171
- # @return [Object]
172
- def from_right
173
- value
174
- end
175
-
176
- # Map over left value
177
- #
178
- # @return [Either::Right<Object>]
179
- def lmap(&block)
180
- require_block(&block)
181
- end
182
-
183
- # Evaluate right side of branch
184
- #
185
- # @param [#call] _left
186
- # @param [#call] right
187
- def either(_left, right)
188
- right.call(value)
189
- end
190
- end # Right
191
- end # Either
192
- end # Mutant