free_mutant/lib/mutant/matcher/method/instance.rb
Markus Schirp 10c3dfc390 Finalize method matching
* Add tests for all edge cases I could create
* Add infrastructure for loading mutations into the vm.
* The fun part is next!
2012-07-26 19:25:23 +02:00

46 lines
902 B
Ruby

module Mutant
class Matcher
class Method < Matcher
# Matcher for instance methods
class Instance < Method
private
# Return method instance
#
# @return [UnboundMethod]
#
# @api private
#
def method
constant.instance_method(method_name)
end
# Return matched node class
#
# @return [Rubinius::AST::Define]
#
# @api private
#
def node_class
Rubinius::AST::Define
end
# Return matched node
#
# @return [Rubinus::AST::Define]
#
# @api private
#
def matched_node
last_match = nil
ast.walk do |predicate, node|
last_match = node if match?(node)
predicate
end
last_match
end
end
end
end
end