Correct implementation of match_prefix es
This commit is contained in:
parent
f70dc6703f
commit
c8d16fdec3
2 changed files with 5 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue