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
 | 
			
		||||
      #
 | 
			
		||||
      def match_prefixes
 | 
			
		||||
        name_nesting.reverse
 | 
			
		||||
        names = name_nesting
 | 
			
		||||
        names.length.downto(1).map do |last|
 | 
			
		||||
          names[0...last].join('::')
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
      memoize :match_prefixes
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -99,7 +99,7 @@ module Mutant
 | 
			
		|||
    # @api private
 | 
			
		||||
    #
 | 
			
		||||
    def match_prefixes
 | 
			
		||||
      context.match_prefixes.dup << match_expression
 | 
			
		||||
      [match_expression].concat(context.match_prefixes)
 | 
			
		||||
    end
 | 
			
		||||
    memoize :match_prefixes
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue