mutant 0.3.0.beta15 → 0.3.0.beta16
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/config/flay.yml +1 -1
- data/config/reek.yml +2 -0
- data/lib/mutant.rb +1 -0
- data/lib/mutant/mutator/node/generic.rb +1 -1
- data/lib/mutant/mutator/node/splat.rb +28 -0
- data/lib/mutant/runner.rb +5 -5
- data/lib/mutant/subject/method/instance.rb +7 -4
- data/mutant.gemspec +1 -1
- data/spec/unit/mutant/mutator/node/send/mutation_spec.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38a209c1a41689899473f5ffd76d4778793ae359
|
4
|
+
data.tar.gz: 36a5e1f2cce948d7eec65367d905578f55007359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 559f63b87a732ccaec3da0135beb866f07aee549d659ffdf8842c39ba6660d4a6c62c49e4c2b14facfd1e826dd340bcfa94e5696c2ca474db459dbfabf75655e
|
7
|
+
data.tar.gz: 77faa291d42db7fb15a7150919bda98827130e876f1a3b2d987677a972e2e0f7c6efa5e6eea816c2e1ab877e8e2f8e61f8ae5374754441a01960853e7ccdb238
|
data/config/flay.yml
CHANGED
data/config/reek.yml
CHANGED
@@ -64,6 +64,7 @@ TooManyInstanceVariables:
|
|
64
64
|
- Mutant::CLI # 4 vars
|
65
65
|
- Mutant::Killer # 4 vars
|
66
66
|
- Mutant::Mutator # 4 vars
|
67
|
+
- Mutant::Runner # 4 vars
|
67
68
|
max_instance_variables: 3
|
68
69
|
TooManyMethods:
|
69
70
|
enabled: true
|
@@ -79,6 +80,7 @@ TooManyStatements:
|
|
79
80
|
- Mutant::Reporter::CLI::Printer::Config::Runner#run
|
80
81
|
- Mutant#self.singleton_subclass_instance
|
81
82
|
- Mutant::Zombifier::File#self.find_uncached
|
83
|
+
- Mutant::Runner#dispatch
|
82
84
|
max_statements: 6
|
83
85
|
UncommunicativeMethodName:
|
84
86
|
enabled: true
|
data/lib/mutant.rb
CHANGED
@@ -69,6 +69,7 @@ require 'mutant/mutator/node/return'
|
|
69
69
|
require 'mutant/mutator/node/block'
|
70
70
|
require 'mutant/mutator/node/if'
|
71
71
|
require 'mutant/mutator/node/case'
|
72
|
+
require 'mutant/mutator/node/splat'
|
72
73
|
require 'mutant/config'
|
73
74
|
require 'mutant/loader'
|
74
75
|
require 'mutant/context'
|
@@ -12,7 +12,7 @@ module Mutant
|
|
12
12
|
:zsuper, :not, :or, :and, :defined,
|
13
13
|
:next, :break, :match, :gvar, :cvar, :ensure,
|
14
14
|
:dstr, :dsym, :yield, :rescue, :redo, :defined?,
|
15
|
-
:lvar, :
|
15
|
+
:lvar, :const, :blockarg, :block_pass, :op_asgn, :and_asgn,
|
16
16
|
:regopt, :ivar, :restarg, :casgn, :resbody, :retry, :arg_expr,
|
17
17
|
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :cbase, :empty,
|
18
18
|
:alias, :for, :xstr, :back_ref, :nth_ref, :class,
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Mutant
|
2
|
+
class Mutator
|
3
|
+
class Node
|
4
|
+
# Mutator for splat nodes
|
5
|
+
class Splat < self
|
6
|
+
|
7
|
+
handle :splat
|
8
|
+
|
9
|
+
children :expression
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
# Perform dispatch
|
14
|
+
#
|
15
|
+
# @return [undefined]
|
16
|
+
#
|
17
|
+
# @api private
|
18
|
+
#
|
19
|
+
def dispatch
|
20
|
+
emit_nil
|
21
|
+
emit_expression_mutations
|
22
|
+
emit(expression)
|
23
|
+
end
|
24
|
+
|
25
|
+
end # Splat
|
26
|
+
end # Node
|
27
|
+
end # Mutator
|
28
|
+
end # Mutant
|
data/lib/mutant/runner.rb
CHANGED
@@ -14,7 +14,7 @@ module Mutant
|
|
14
14
|
# @api private
|
15
15
|
#
|
16
16
|
def self.register(klass)
|
17
|
-
REGISTRY[klass]=self
|
17
|
+
REGISTRY[klass] = self
|
18
18
|
end
|
19
19
|
private_class_method :register
|
20
20
|
|
@@ -29,10 +29,8 @@ module Mutant
|
|
29
29
|
def self.lookup(klass)
|
30
30
|
current = klass
|
31
31
|
while current
|
32
|
-
|
33
|
-
|
34
|
-
end
|
35
|
-
return handler if handler
|
32
|
+
return REGISTRY.fetch(current) if REGISTRY.key?(current)
|
33
|
+
current = current.superclass
|
36
34
|
end
|
37
35
|
|
38
36
|
raise ArgumentError, "No handler for: #{klass}"
|
@@ -84,6 +82,8 @@ module Mutant
|
|
84
82
|
# @return [false]
|
85
83
|
# otherwise
|
86
84
|
#
|
85
|
+
# @api private
|
86
|
+
#
|
87
87
|
def stop?
|
88
88
|
!!@stop
|
89
89
|
end
|
@@ -32,13 +32,16 @@ module Mutant
|
|
32
32
|
|
33
33
|
# Return mutations
|
34
34
|
#
|
35
|
-
# @
|
35
|
+
# @param [#<<] emitter
|
36
|
+
#
|
37
|
+
# @return [undefined]
|
36
38
|
#
|
37
39
|
# @api private
|
38
40
|
#
|
39
|
-
def
|
40
|
-
|
41
|
-
|
41
|
+
def generate_mutations(emitter)
|
42
|
+
emitter << noop_mutation
|
43
|
+
Mutator.each(node) do |mutant|
|
44
|
+
emitter << Mutation::Evil.new(self, memoizer_node(mutant))
|
42
45
|
end
|
43
46
|
end
|
44
47
|
|
data/mutant.gemspec
CHANGED
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.3.0.
|
4
|
+
version: 0.3.0.beta16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -245,6 +245,7 @@ files:
|
|
245
245
|
- lib/mutant/mutator/node/return.rb
|
246
246
|
- lib/mutant/mutator/node/send.rb
|
247
247
|
- lib/mutant/mutator/node/send/binary.rb
|
248
|
+
- lib/mutant/mutator/node/splat.rb
|
248
249
|
- lib/mutant/mutator/node/super.rb
|
249
250
|
- lib/mutant/mutator/node/when.rb
|
250
251
|
- lib/mutant/mutator/node/while.rb
|