Correct implementation of match_prefix es

This commit is contained in:
Markus Schirp 2013-08-04 19:30:34 +02:00
parent f70dc6703f
commit c8d16fdec3
2 changed files with 5 additions and 2 deletions

View file

@ -96,7 +96,10 @@ module Mutant
# @api private # @api private
# #
def match_prefixes def match_prefixes
name_nesting.reverse names = name_nesting
names.length.downto(1).map do |last|
names[0...last].join('::')
end
end end
memoize :match_prefixes memoize :match_prefixes

View file

@ -99,7 +99,7 @@ module Mutant
# @api private # @api private
# #
def match_prefixes def match_prefixes
context.match_prefixes.dup << match_expression [match_expression].concat(context.match_prefixes)
end end
memoize :match_prefixes memoize :match_prefixes