mutant 0.9.13 → 0.10.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,7 @@ module Mutant
8
8
  class AttributeAssignment < self
9
9
 
10
10
  ATTRIBUTE_RANGE = (0..-2).freeze
11
+
11
12
  private_constant(*constants(false))
12
13
 
13
14
  private
@@ -14,8 +14,8 @@ module Mutant
14
14
  # @return [undefined]
15
15
  def run
16
16
  info 'Matcher: %s', object.matcher.inspect
17
- info 'Integration: %s', object.integration
18
- info 'Jobs: %d', object.jobs
17
+ info 'Integration: %s', object.integration || 'null'
18
+ info 'Jobs: %s', object.jobs || 'auto'
19
19
  info 'Includes: %s', object.includes
20
20
  info 'Requires: %s', object.requires
21
21
  end
@@ -14,7 +14,9 @@ module Mutant
14
14
  def call(subject)
15
15
  subject.match_expressions.each do |match_expression|
16
16
  subject_tests = integration.all_tests.select do |test|
17
- match_expression.prefix?(test.expression)
17
+ test.expressions.any? do |test_expression|
18
+ match_expression.prefix?(test_expression)
19
+ end
18
20
  end
19
21
  return subject_tests if subject_tests.any?
20
22
  end
@@ -42,7 +42,7 @@ module Mutant
42
42
  private
43
43
 
44
44
  def wrap_node(mutant)
45
- s(:begin, mutant, s(:send, nil, :memoize, s(:args, s(:sym, name), *options)))
45
+ s(:begin, mutant, s(:send, nil, :memoize, s(:sym, name), *options))
46
46
  end
47
47
 
48
48
  # The optional AST node for adamantium memoization options
@@ -4,7 +4,7 @@ module Mutant
4
4
  # Abstract base class for test that might kill a mutation
5
5
  class Test
6
6
  include Adamantium::Flat, Anima.new(
7
- :expression,
7
+ :expressions,
8
8
  :id
9
9
  )
10
10
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.9.13'
5
+ VERSION = '0.10.5'
6
6
  end # Mutant
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mutant
4
+ # The outer world IO objects mutant does interact with
5
+ class World
6
+ include Adamantium::Flat, Anima.new(
7
+ :condition_variable,
8
+ :gem,
9
+ :gem_method,
10
+ :io,
11
+ :json,
12
+ :kernel,
13
+ :load_path,
14
+ :marshal,
15
+ :mutex,
16
+ :object_space,
17
+ :open3,
18
+ :pathname,
19
+ :process,
20
+ :stderr,
21
+ :stdout,
22
+ :thread,
23
+ :warnings
24
+ )
25
+
26
+ INSPECT = '#<Mutant::World>'
27
+
28
+ private_constant(*constants(false))
29
+
30
+ # Object inspection
31
+ #
32
+ # @return [String]
33
+ def inspect
34
+ INSPECT
35
+ end
36
+
37
+ # Capture stdout of a command
38
+ #
39
+ # @param [Array<String>] command
40
+ #
41
+ # @return [Either<String,String>]
42
+ def capture_stdout(command)
43
+ stdout, status = open3.capture2(*command, binmode: true)
44
+
45
+ if status.success?
46
+ Either::Right.new(stdout)
47
+ else
48
+ Either::Left.new("Command #{command} failed!")
49
+ end
50
+ end
51
+ end # World
52
+ end # Mutant
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.13
4
+ version: 0.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2020-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abstract_type
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.4.8
187
+ version: 0.5.3
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 0.4.8
194
+ version: 0.5.3
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: variable
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -254,28 +254,28 @@ dependencies:
254
254
  requirements:
255
255
  - - "~>"
256
256
  - !ruby/object:Gem::Version
257
- version: 1.2.0
257
+ version: 1.3.0
258
258
  type: :development
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
262
  - - "~>"
263
263
  - !ruby/object:Gem::Version
264
- version: 1.2.0
264
+ version: 1.3.0
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: rubocop
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
269
  - - "~>"
270
270
  - !ruby/object:Gem::Version
271
- version: 0.79.0
271
+ version: '1.0'
272
272
  type: :development
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - "~>"
277
277
  - !ruby/object:Gem::Version
278
- version: 0.79.0
278
+ version: '1.0'
279
279
  description: Mutation Testing for Ruby.
280
280
  email:
281
281
  - mbj@schirp-dso.com
@@ -303,6 +303,10 @@ files:
303
303
  - lib/mutant/ast/types.rb
304
304
  - lib/mutant/bootstrap.rb
305
305
  - lib/mutant/cli.rb
306
+ - lib/mutant/cli/command.rb
307
+ - lib/mutant/cli/command/root.rb
308
+ - lib/mutant/cli/command/run.rb
309
+ - lib/mutant/cli/command/subscription.rb
306
310
  - lib/mutant/config.rb
307
311
  - lib/mutant/context.rb
308
312
  - lib/mutant/env.rb
@@ -338,7 +342,6 @@ files:
338
342
  - lib/mutant/meta/example.rb
339
343
  - lib/mutant/meta/example/dsl.rb
340
344
  - lib/mutant/meta/example/verification.rb
341
- - lib/mutant/minitest/coverage.rb
342
345
  - lib/mutant/mutation.rb
343
346
  - lib/mutant/mutator.rb
344
347
  - lib/mutant/mutator/node.rb
@@ -356,8 +359,7 @@ files:
356
359
  - lib/mutant/mutator/node/const.rb
357
360
  - lib/mutant/mutator/node/define.rb
358
361
  - lib/mutant/mutator/node/defined.rb
359
- - lib/mutant/mutator/node/dstr.rb
360
- - lib/mutant/mutator/node/dsym.rb
362
+ - lib/mutant/mutator/node/dynamic_literal.rb
361
363
  - lib/mutant/mutator/node/generic.rb
362
364
  - lib/mutant/mutator/node/if.rb
363
365
  - lib/mutant/mutator/node/index.rb
@@ -448,6 +450,7 @@ files:
448
450
  - lib/mutant/util.rb
449
451
  - lib/mutant/version.rb
450
452
  - lib/mutant/warnings.rb
453
+ - lib/mutant/world.rb
451
454
  - lib/mutant/zombifier.rb
452
455
  homepage: https://github.com/mbj/mutant
453
456
  licenses:
@@ -461,14 +464,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
461
464
  requirements:
462
465
  - - ">="
463
466
  - !ruby/object:Gem::Version
464
- version: '0'
467
+ version: '2.5'
465
468
  required_rubygems_version: !ruby/object:Gem::Requirement
466
469
  requirements:
467
470
  - - ">="
468
471
  - !ruby/object:Gem::Version
469
472
  version: '0'
470
473
  requirements: []
471
- rubygems_version: 3.1.2
474
+ rubygems_version: 3.1.4
472
475
  signing_key:
473
476
  specification_version: 4
474
477
  summary: ''
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'minitest'
4
-
5
- module Mutant
6
- module Minitest
7
- module Coverage
8
- # Setup coverage declaration for current class
9
- #
10
- # @param [String]
11
- #
12
- # @example
13
- #
14
- # class MyTest < MiniTest::Test
15
- # cover 'MyCode*'
16
- #
17
- # def test_some_stuff
18
- # end
19
- # end
20
- #
21
- # @api public
22
- def cover(expression)
23
- if defined?(@cover_expression)
24
- fail "#{self} already declares to cover: #{@cover_expression.inspect}"
25
- end
26
-
27
- @cover_expression = expression
28
- end
29
-
30
- # Effective coverage expression
31
- #
32
- # @return [String, nil]
33
- #
34
- # @api private
35
- def resolve_cover_expression
36
- return @cover_expression if defined?(@cover_expression)
37
-
38
- try_superclass_cover_expression
39
- end
40
-
41
- private
42
-
43
- def try_superclass_cover_expression
44
- return if superclass.equal?(::Minitest::Runnable)
45
-
46
- superclass.resolve_cover_expression
47
- end
48
-
49
- end # Coverage
50
- end # Minitest
51
- end # Mutant
52
-
53
- Minitest::Test.extend(Mutant::Minitest::Coverage)
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mutant
4
- class Mutator
5
- class Node
6
-
7
- # Dsym mutator
8
- class Dsym < Generic
9
-
10
- handle(:dsym)
11
-
12
- private
13
-
14
- def dispatch
15
- super()
16
- emit_singletons
17
- end
18
-
19
- end # Dsym
20
- end # Node
21
- end # Mutator
22
- end # Mutant