mutant 0.3.0.beta9 → 0.3.0.beta10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2680d48343b2c5b7122252e999dceca9fb51ff4a
4
- data.tar.gz: 3fe806d025ebb900b98f863aff8e11b0dffa7fed
3
+ metadata.gz: fc832675fb1166a4b6fe2d230eddabe007c90a5b
4
+ data.tar.gz: d8bab5543136ddc23c6ce09b5eb763f8afde66c8
5
5
  SHA512:
6
- metadata.gz: e8a6cd662eb49939f08df67a418edd884c8b7318cc4b2b6ab1d630118ce7ec3f0448c508e65678b866379e5ba4b37f8ea46e2bc355e164affbd880b3aa33fcbb
7
- data.tar.gz: d3bab712b12881bc4cf816dbedac61568f4d928e09f2c1cf9d2618ec2e908674fa5b8f5cdb453ec1d6da6abb8f1a77c7da58f5c96720808631b295c9a8c197c2
6
+ metadata.gz: 81c5c3604e37bcdf69e56200dc44d21688749f025c09b68dc1bd07ddb3a15cc8cc67a856d7d94e7e0b0228fc86ea7b95915d88046421720950282a5eed497235
7
+ data.tar.gz: 304fd7f04b962753bfad76e14d65912b74b50036dcf84b5e6ad0ad4cf397aea9ca8bf9014438bb379dbd4a33ffa1af9369d170e6ef14e2ec6f17608763fb85ab
@@ -123,8 +123,7 @@ module Mutant
123
123
  # @api private
124
124
  #
125
125
  def mutate_child(index, mutator = Mutator)
126
- children = node.children
127
- child = children[index]
126
+ child = children.at(index)
128
127
  mutator.each(child, self) do |mutation|
129
128
  emit_child_update(index, mutation)
130
129
  end
@@ -147,15 +146,15 @@ module Mutant
147
146
  # Emit updated child
148
147
  #
149
148
  # @param [Fixnum] index
150
- # @param [Object] update
149
+ # @param [Parser::AST::Node] node
151
150
  #
152
151
  # @return [undefined]
153
152
  #
154
153
  # @api private
155
154
  #
156
- def emit_child_update(index, update)
155
+ def emit_child_update(index, node)
157
156
  new_children = children.dup
158
- new_children[index]=update
157
+ new_children[index]=node
159
158
  emit_self(*new_children)
160
159
  end
161
160
 
@@ -28,7 +28,7 @@ module Mutant
28
28
  #
29
29
  def dispatch
30
30
  mutate_name
31
- emit_value_mutations
31
+ emit_value_mutations if value # mlhs!
32
32
  end
33
33
 
34
34
  # Emit name mutations
@@ -24,7 +24,6 @@ module Mutant
24
24
  children.each do |child|
25
25
  emit(child)
26
26
  end
27
- emit(nil) unless parent_send?
28
27
  end
29
28
 
30
29
  # Test if parent input is a send
@@ -22,6 +22,7 @@ module Mutant
22
22
  if body
23
23
  emit_body_mutations
24
24
  end
25
+ emit_body(nil)
25
26
  emit_body(RAISE)
26
27
  end
27
28
 
@@ -15,6 +15,7 @@ module Mutant
15
15
  def dispatch
16
16
  emit_arguments_mutations
17
17
  emit_body(RAISE)
18
+ emit_body(nil)
18
19
  emit_body_mutations if body
19
20
  end
20
21
 
@@ -28,7 +28,9 @@ module Mutant
28
28
  #
29
29
  def dispatch
30
30
  children.each_index do |index|
31
- mutate_child(index) if children.at(index)
31
+ if children.at(index).kind_of?(Parser::AST::Node)
32
+ mutate_child(index)
33
+ end
32
34
  end
33
35
  end
34
36
 
data/mutant.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'mutant'
5
- gem.version = '0.3.0.beta9'
5
+ gem.version = '0.3.0.beta10'
6
6
  gem.authors = [ 'Markus Schirp' ]
7
7
  gem.email = [ 'mbj@schirp-dso.com' ]
8
8
 
@@ -24,9 +24,6 @@ describe Mutant::Mutator, 'begin' do
24
24
  # Remove statement in block
25
25
  mutations << 'true'
26
26
  mutations << 'false'
27
-
28
- # Replace block with empty
29
- mutations << ''
30
27
  end
31
28
 
32
29
  it_should_behave_like 'a mutator'
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.beta9
4
+ version: 0.3.0.beta10
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-04 00:00:00.000000000 Z
11
+ date: 2013-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser