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
# File 'lib/mutant/meta.rb', line 18

def self.add(&block)
  ALL << DSL.run(block)
end

Instance Method Details

#generatedEmumerable<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:



35
36
37
38
39
# File 'lib/mutant/meta/example.rb', line 35

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)


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

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:



14
15
16
# File 'lib/mutant/meta/example.rb', line 14

def verification
  Verification.new(self, generated)
end