Class: Mutant::Mutation
- Inherits:
-
Object
- Object
- Mutant::Mutation
- Includes:
- AbstractType, Adamantium::Flat
- Defined in:
- lib/mutant/mutation.rb,
lib/mutant/mutation/evil.rb,
lib/mutant/mutation/neutral.rb
Overview
Represent a mutated node with its subject
Defined Under Namespace
Instance Method Summary collapse
-
#code ⇒ String
private
Return mutation code.
-
#identification ⇒ String
private
Return identification.
-
#insert ⇒ self
private
Insert mutated node.
-
#original_source ⇒ String
private
Return original source.
-
#root ⇒ Parser::AST::Node
private
Return mutated root node.
-
#source ⇒ String
private
Return source.
-
#success? ⇒ true, false
private
Test if killer is successful.
Instance Method Details
#code ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return mutation code
66 67 68 |
# File 'lib/mutant/mutation.rb', line 66 def code sha1[0..4] end |
#identification ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return identification
56 57 58 |
# File 'lib/mutant/mutation.rb', line 56 def identification "#{subject.identification}:#{code}" end |
#insert ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Insert mutated node
FIXME: Cache subject visibility in a better way! Ideally dont mutate it
implicitly. Also subject.public? should NOT be a public interface it
is a detail of method mutations.
44 45 46 47 48 |
# File 'lib/mutant/mutation.rb', line 44 def insert subject.public? Loader::Eval.call(root, subject) self end |
#original_source ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return original source
88 89 90 |
# File 'lib/mutant/mutation.rb', line 88 def original_source subject.source end |
#root ⇒ Parser::AST::Node
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return mutated root node
15 16 17 |
# File 'lib/mutant/mutation.rb', line 15 def root subject.root(node) end |
#source ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return source
77 78 79 |
# File 'lib/mutant/mutation.rb', line 77 def source Unparser.unparse(node) end |
#success? ⇒ true, false
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if killer is successful
32 |
# File 'lib/mutant/mutation.rb', line 32 abstract_method :success? |