Class: Mutest::Subject Private
- Inherits:
-
Object
- Object
- Mutest::Subject
- Includes:
- AbstractType, Adamantium::Flat, Enumerable
- Defined in:
- lib/mutest/subject.rb,
lib/mutest/subject/method.rb,
lib/mutest/subject/method/instance.rb,
lib/mutest/subject/method/singleton.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Subject of a mutation
Direct Known Subclasses
Defined Under Namespace
Classes: Method
Instance Method Summary collapse
-
#expression ⇒ Expression
private
Match expression.
-
#identification ⇒ String
private
Identification string.
-
#match_expressions ⇒ Enumerable<Expression>
private
Match expressions.
-
#mutations ⇒ Enumerable<Mutation>, undefined
private
Mutations for this subject.
-
#prepare ⇒ self
private
Prepare subject for insertion of mutation.
-
#source ⇒ String
private
Source representation of AST.
-
#source_line ⇒ Fixnum
private
First source line.
-
#source_lines ⇒ Range<Fixnum>
private
Source line range.
-
#source_path ⇒ Pathname
private
Source path.
Instance Method Details
#expression ⇒ Expression
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.
Match expression
69 |
# File 'lib/mutest/subject.rb', line 69 abstract_method :expression |
#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.
Identification string
53 54 55 |
# File 'lib/mutest/subject.rb', line 53 def identification "#{expression.syntax}:#{source_path}:#{source_line}" end |
#match_expressions ⇒ Enumerable<Expression>
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.
Match expressions
74 |
# File 'lib/mutest/subject.rb', line 74 abstract_method :match_expressions |
#mutations ⇒ Enumerable<Mutation>, undefined
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.
Mutations for this subject
11 12 13 14 15 16 17 |
# File 'lib/mutest/subject.rb', line 11 def mutations [neutral_mutation].concat( Mutator.mutate(node, context.method(:ignore?)).map do |mutant| Mutation::Evil.new(self, wrap_node(mutant)) end ) end |
#prepare ⇒ 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.
Prepare subject for insertion of mutation
30 31 32 |
# File 'lib/mutest/subject.rb', line 30 def prepare self 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.
Source representation of AST
61 62 63 |
# File 'lib/mutest/subject.rb', line 61 def source Unparser.unparse(wrap_node(node)) end |
#source_line ⇒ Fixnum
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.
First source line
46 47 48 |
# File 'lib/mutest/subject.rb', line 46 def source_line source_lines.begin end |
#source_lines ⇒ Range<Fixnum>
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.
Source line range
37 38 39 40 |
# File 'lib/mutest/subject.rb', line 37 def source_lines expression = node.location.expression expression.line..expression.source_buffer.decompose_position(expression.end_pos).first end |
#source_path ⇒ Pathname
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.
Source path
23 24 25 |
# File 'lib/mutest/subject.rb', line 23 def source_path context.source_path end |