free_mutant/lib/mutant/matcher/method/instance.rb
Markus Schirp dc083547f5 Connect cli with runner.
Only supports the testing of testapp... but time will come!
2012-11-21 22:28:08 +01:00

52 lines
1 KiB
Ruby

module Mutant
class Matcher
class Method < self
# Matcher for instance methods
class Instance < self
# Return identification
#
# @return [String]
#
# @api private
#
def identification
"#{scope.name}##{method_name}"
end
private
# Check if node is matched
#
# @param [Rubinius::AST::Node] node
#
# @return [true]
# returns true if node matches method
#
# @return [false]
# returns false if node NOT matches method
#
# @api private
#
def match?(node)
node.line == source_line &&
node.class == Rubinius::AST::Define &&
node.name == method_name
end
# Return method instance
#
# @return [UnboundMethod]
#
# @api private
#
def method
scope.instance_method(method_name)
end
memoize :method, :freezer => :noop
end
end
end
end