diff --git a/lib/mutant/mutator/literal/boolean.rb b/lib/mutant/mutator/literal/boolean.rb index d0bbe5dd..625bfc18 100644 --- a/lib/mutant/mutator/literal/boolean.rb +++ b/lib/mutant/mutator/literal/boolean.rb @@ -27,7 +27,7 @@ module Mutant new(self.class::INVERSE_CLASS) end - # Represent mutations of true literal + # Mutator for true literals class TrueLiteral < self INVERSE_CLASS = Rubinius::AST::FalseLiteral @@ -35,7 +35,7 @@ module Mutant end - # Represent mutations of false literal + # Mutator for false literals class FalseLiteral < self INVERSE_CLASS = Rubinius::AST::TrueLiteral diff --git a/lib/mutant/mutator/literal/dynamic.rb b/lib/mutant/mutator/literal/dynamic.rb index f99c5807..01b5f59a 100644 --- a/lib/mutant/mutator/literal/dynamic.rb +++ b/lib/mutant/mutator/literal/dynamic.rb @@ -3,6 +3,7 @@ module Mutant class Literal # Abstract mutations on dynamic literals class Dynamic < self + include AbstractType private diff --git a/lib/mutant/mutator/literal/fixnum.rb b/lib/mutant/mutator/literal/fixnum.rb index 5f2cf044..68225f11 100644 --- a/lib/mutant/mutator/literal/fixnum.rb +++ b/lib/mutant/mutator/literal/fixnum.rb @@ -1,7 +1,7 @@ module Mutant class Mutator class Literal < self - # Represent mutations on fixnum literal + # Mutator for fixnum literals class Fixnum < self handle(Rubinius::AST::FixnumLiteral) diff --git a/lib/mutant/mutator/literal/float.rb b/lib/mutant/mutator/literal/float.rb index 1ec797fa..5ea2423b 100644 --- a/lib/mutant/mutator/literal/float.rb +++ b/lib/mutant/mutator/literal/float.rb @@ -1,7 +1,7 @@ module Mutant class Mutator class Literal < self - # Represent mutations on fixnum literal + # Mutator for float literals class Float < self handle(Rubinius::AST::FloatLiteral) diff --git a/lib/mutant/mutator/literal/hash.rb b/lib/mutant/mutator/literal/hash.rb index 6795ce9f..d56812d7 100644 --- a/lib/mutant/mutator/literal/hash.rb +++ b/lib/mutant/mutator/literal/hash.rb @@ -1,7 +1,7 @@ module Mutant class Mutator - class Literal - # Mutator for hash literal AST nodes + class Literal + # Mutator for hash literals class Hash < self handle(Rubinius::AST::HashLiteral) diff --git a/lib/mutant/mutator/literal/nil.rb b/lib/mutant/mutator/literal/nil.rb new file mode 100644 index 00000000..4ef36ea3 --- /dev/null +++ b/lib/mutant/mutator/literal/nil.rb @@ -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 diff --git a/lib/mutant/mutator/literal/regex.rb b/lib/mutant/mutator/literal/regex.rb index a60922c6..e927dea3 100644 --- a/lib/mutant/mutator/literal/regex.rb +++ b/lib/mutant/mutator/literal/regex.rb @@ -1,7 +1,7 @@ module Mutant class Mutator class Literal < self - # Mutator for regexp literal AST nodes + # Mutator for regexp literals class Regex < self handle(Rubinius::AST::RegexLiteral) diff --git a/lib/mutant/mutator/literal/string.rb b/lib/mutant/mutator/literal/string.rb index f88b0b4b..d58d3d4e 100644 --- a/lib/mutant/mutator/literal/string.rb +++ b/lib/mutant/mutator/literal/string.rb @@ -1,7 +1,7 @@ module Mutant class Mutator class Literal - # Represent mutations on string literal + # Mutator for string literals class String < self handle(Rubinius::AST::StringLiteral) diff --git a/lib/mutant/mutator/literal/symbol.rb b/lib/mutant/mutator/literal/symbol.rb index 573ab8b3..6a2bfe63 100644 --- a/lib/mutant/mutator/literal/symbol.rb +++ b/lib/mutant/mutator/literal/symbol.rb @@ -1,7 +1,7 @@ module Mutant class Mutator class Literal < self - # Represent mutations on symbol literal + # Mutator for symbol literals class Symbol < self handle(Rubinius::AST::SymbolLiteral)