Correctly emit memoizers for memoized method mutations

This commit is contained in:
Markus Schirp 2013-07-05 13:28:21 +02:00
parent 2051731fbd
commit 023df844f9
4 changed files with 14 additions and 0 deletions

View file

@ -59,6 +59,7 @@ module Mutant
# Matcher for memoized instance methods
class Memoized < self
SUBJECT_CLASS = Subject::Method::Instance::Memoized
private

View file

@ -7,6 +7,7 @@ module Mutant
class Subject < self
handle(Mutant::Subject::Method::Instance)
handle(Mutant::Subject::Method::Instance::Memoized)
handle(Mutant::Subject::Method::Singleton)
# Run subject results printer

View file

@ -96,6 +96,7 @@ module Mutant
# Instance method dm2 style method lookup
class Instance < self
handle(Subject::Method::Instance)
handle(Subject::Method::Instance::Memoized)
private

View file

@ -26,6 +26,7 @@ module Mutant
# Mutator for memoized instance methods
class Memoized < self
include NodeHelpers
private
@ -41,6 +42,16 @@ module Mutant
end
end
# Return neutral mutation
#
# @return [Mutation::Neutral]
#
# @api private
#
def noop_mutation
Mutation::Neutral::Noop.new(self, memoizer_node(node))
end
# Return memoizer node for mutant
#
# @param [Parser::AST::Node] mutant