Class: Mutant::Meta::Example Private

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

rubocop:disable Performance/Caller

Returns:

  • (undefined)


21
22
23
24
# File 'lib/mutant/meta.rb', line 21

def self.add(*types, &block)
  file = caller.first.split(':in', 2).first
  ALL << DSL.call(file, Set.new(types), block)
end

Instance Method Details

#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

Returns:



27
28
29
30
31
# File 'lib/mutant/meta/example.rb', line 27

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

#sourceString

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.

Normalized source

Returns:

  • (String)


19
20
21
# File 'lib/mutant/meta/example.rb', line 19

def source
  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

Returns:



11
12
13
# File 'lib/mutant/meta/example.rb', line 11

def verification
  Verification.new(self, generated)
end