Class: Mutant::Meta::Example

Inherits:
Object
  • Object
show all
Includes:
Adamantium
Defined in:
lib/mutant/meta.rb,
lib/mutant/meta/example.rb,
lib/mutant/meta/example/dsl.rb

Overview

Mutation example

Defined Under Namespace

Classes: DSL, Verification

Constant Summary collapse

ALL =
[]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.add(&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

Returns:

  • (undefined)


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

def self.add(&block)
  file = caller.first.split(':in', 2).first
  ALL << DSL.run(file, 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.

Return generated mutations

Returns:



33
34
35
36
37
# File 'lib/mutant/meta/example.rb', line 33

def generated
  Mutant::Mutator.each(node).map do |node|
    Mutant::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.

Return source

Returns:

  • (String)


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

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.

Return a verification instance

Returns:



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

def verification
  Verification.new(self, generated)
end