diff --git a/lib/mutant/mutator/literal/boolean.rb b/lib/mutant/mutator/literal/boolean.rb index 2b2bdf06..a2d640f5 100644 --- a/lib/mutant/mutator/literal/boolean.rb +++ b/lib/mutant/mutator/literal/boolean.rb @@ -23,43 +23,23 @@ module Mutant # # @api private # - abstract_method :inverse + def inverse + new(self.class::INVERSE_CLASS) + end # Represent mutations of true literal class TrueLiteral < Boolean + INVERSE_CLASS = Rubinius::AST::FalseLiteral handle(Rubinius::AST::TrueLiteral) - - private - - # Return inverse - # - # @return [Rubinius::AST::FalseLiteral] - # - # @api private - # - def inverse - new(Rubinius::AST::FalseLiteral) - end end # Represent mutations of false literal class FalseLiteral < Boolean + INVERSE_CLASS = Rubinius::AST::TrueLiteral handle(Rubinius::AST::FalseLiteral) - - private - - # Return inverse class - # - # @return [Rubinius::AST::TrueLiteral] - # - # @api private - # - def inverse - new(Rubinius::AST::TrueLiteral) - end end end end diff --git a/spec/unit/mutant/mutator/literal/boolean_spec.rb b/spec/unit/mutant/mutator/literal/boolean/mutation_spec.rb similarity index 100% rename from spec/unit/mutant/mutator/literal/boolean_spec.rb rename to spec/unit/mutant/mutator/literal/boolean/mutation_spec.rb