Class: Mutant::Meta::Example Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Class Method Details

.add(*types, &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
# File 'lib/mutant/meta.rb', line 19

def self.add(*types, &block)
  ALL << DSL.call(caller_locations(1).first, Set.new(types), block)
end

Instance Method Details

#contextContext

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



39
40
41
42
43
44
# File 'lib/mutant/meta/example.rb', line 39

def context
  Context.new(
    Object,
    location.path
  )
end

#generatedEnumerable<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



57
58
59
60
61
# File 'lib/mutant/meta/example.rb', line 57

def generated
  Mutator.mutate(node).map do |node|
    Mutation::Evil.new(self, node)
  end
end

#identificationString

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



32
33
34
# File 'lib/mutant/meta/example.rb', line 32

def identification
  location.to_s
end

#original_source_generatedString

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



49
50
51
# File 'lib/mutant/meta/example.rb', line 49

def original_source_generated
  Unparser.unparse(node)
end

#verificationVerification

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



24
25
26
# File 'lib/mutant/meta/example.rb', line 24

def verification
  Verification.new(self, generated)
end