Class: Mutant::Meta::Example Private
- Inherits:
-
Object
- Object
- Mutant::Meta::Example
- Includes:
- Unparser::Adamantium
- Defined in:
- lib/mutant/meta.rb,
lib/mutant/meta/example.rb,
lib/mutant/meta/example/dsl.rb,
lib/mutant/meta/example/verification.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.
Mutation example
Defined Under Namespace
Classes: DSL, Expected, Verification
Constant Summary collapse
- ALL =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
rubocop:disable Style/MutableConstant
[]
Class Method Summary collapse
-
.add(*types, operators: :full, &block) ⇒ undefined
private
Add example.
Instance Method Summary collapse
-
#context ⇒ Context
private
Context of mutation.
-
#generated ⇒ Enumerable<Mutant::Mutation>
private
Generated mutations on example source.
-
#identification ⇒ String
private
Example identification.
-
#original_source_generated ⇒ String
private
Original source as generated by unparser.
-
#verification ⇒ Verification
private
Verification instance for example.
Class Method Details
.add(*types, operators: :full, &block) ⇒ 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.
Add example
19 20 21 22 23 24 25 26 |
# File 'lib/mutant/meta.rb', line 19 def self.add(*types, operators: :full, &block) ALL << DSL.call( block:, location: caller_locations(1).first, operators: Mutation::Operators.parse(operators.to_s).from_right, types: Set.new(types) ) end |
Instance Method Details
#context ⇒ Context
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.
Context of mutation
40 41 42 43 44 45 46 |
# File 'lib/mutant/meta/example.rb', line 40 def context Context.new( constant_scope: Context::ConstantScope::None.new, scope:, source_path: location.path ) end |
#generated ⇒ Enumerable<Mutant::Mutation>
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.
Generated mutations on example source
59 60 61 62 63 64 65 66 |
# File 'lib/mutant/meta/example.rb', line 59 def generated Mutator::Node.mutate( config: Mutation::Config::DEFAULT.with(operators:), node: ).map do |node| Mutation::Evil.new(subject: self, node:) end 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.
Example identification
33 34 35 |
# File 'lib/mutant/meta/example.rb', line 33 def identification location.to_s end |
#original_source_generated ⇒ 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.
Original source as generated by unparser
51 52 53 |
# File 'lib/mutant/meta/example.rb', line 51 def original_source_generated Unparser.unparse(node) end |
#verification ⇒ Verification
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.
Verification instance for example
25 26 27 |
# File 'lib/mutant/meta/example.rb', line 25 def verification Verification.new(example: self, mutations: generated) end |