Improve documentation of literal mutators

This commit is contained in:
Markus Schirp 2012-12-06 19:23:21 +01:00
parent 48892556fa
commit cf2d685dfc
9 changed files with 33 additions and 9 deletions

View file

@ -27,7 +27,7 @@ module Mutant
new(self.class::INVERSE_CLASS) new(self.class::INVERSE_CLASS)
end end
# Represent mutations of true literal # Mutator for true literals
class TrueLiteral < self class TrueLiteral < self
INVERSE_CLASS = Rubinius::AST::FalseLiteral INVERSE_CLASS = Rubinius::AST::FalseLiteral
@ -35,7 +35,7 @@ module Mutant
end end
# Represent mutations of false literal # Mutator for false literals
class FalseLiteral < self class FalseLiteral < self
INVERSE_CLASS = Rubinius::AST::TrueLiteral INVERSE_CLASS = Rubinius::AST::TrueLiteral

View file

@ -3,6 +3,7 @@ module Mutant
class Literal class Literal
# Abstract mutations on dynamic literals # Abstract mutations on dynamic literals
class Dynamic < self class Dynamic < self
include AbstractType
private private

View file

@ -1,7 +1,7 @@
module Mutant module Mutant
class Mutator class Mutator
class Literal < self class Literal < self
# Represent mutations on fixnum literal # Mutator for fixnum literals
class Fixnum < self class Fixnum < self
handle(Rubinius::AST::FixnumLiteral) handle(Rubinius::AST::FixnumLiteral)

View file

@ -1,7 +1,7 @@
module Mutant module Mutant
class Mutator class Mutator
class Literal < self class Literal < self
# Represent mutations on fixnum literal # Mutator for float literals
class Float < self class Float < self
handle(Rubinius::AST::FloatLiteral) handle(Rubinius::AST::FloatLiteral)

View file

@ -1,7 +1,7 @@
module Mutant module Mutant
class Mutator class Mutator
class Literal class Literal
# Mutator for hash literal AST nodes # Mutator for hash literals
class Hash < self class Hash < self
handle(Rubinius::AST::HashLiteral) handle(Rubinius::AST::HashLiteral)

View file

@ -0,0 +1,23 @@
module Mutant
class Mutator
class Literal
# Mutator for nil literals
class Nil < self
handle(Rubinius::AST::NilLiteral)
private
# Emit mutants
#
# @return [undefined]
#
# @api private
#
def dispatch
emit('Object.new'.to_ast)
end
end
end
end
end

View file

@ -1,7 +1,7 @@
module Mutant module Mutant
class Mutator class Mutator
class Literal < self class Literal < self
# Mutator for regexp literal AST nodes # Mutator for regexp literals
class Regex < self class Regex < self
handle(Rubinius::AST::RegexLiteral) handle(Rubinius::AST::RegexLiteral)

View file

@ -1,7 +1,7 @@
module Mutant module Mutant
class Mutator class Mutator
class Literal class Literal
# Represent mutations on string literal # Mutator for string literals
class String < self class String < self
handle(Rubinius::AST::StringLiteral) handle(Rubinius::AST::StringLiteral)

View file

@ -1,7 +1,7 @@
module Mutant module Mutant
class Mutator class Mutator
class Literal < self class Literal < self
# Represent mutations on symbol literal # Mutator for symbol literals
class Symbol < self class Symbol < self
handle(Rubinius::AST::SymbolLiteral) handle(Rubinius::AST::SymbolLiteral)