mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	MethodNames: correct reported location/end_location
This commit is contained in:
		
							parent
							
								
									e951c0772a
								
							
						
					
					
						commit
						f8dab3bc34
					
				
					 3 changed files with 20 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -40,14 +40,14 @@ module Ameba
 | 
			
		|||
 | 
			
		||||
    it "reports rule, pos and message" do
 | 
			
		||||
      s = Source.new %(
 | 
			
		||||
        def bad_Name
 | 
			
		||||
        def bad_Name(a)
 | 
			
		||||
        end
 | 
			
		||||
      ), "source.cr"
 | 
			
		||||
      subject.catch(s).should_not be_valid
 | 
			
		||||
      issue = s.issues.first
 | 
			
		||||
      issue.rule.should_not be_nil
 | 
			
		||||
      issue.location.to_s.should eq "source.cr:1:1"
 | 
			
		||||
      issue.end_location.to_s.should eq "source.cr:2:3"
 | 
			
		||||
      issue.location.to_s.should eq "source.cr:1:5"
 | 
			
		||||
      issue.end_location.to_s.should eq "source.cr:1:12"
 | 
			
		||||
      issue.message.should eq(
 | 
			
		||||
        "Method name should be underscore-cased: bad_name, not bad_Name"
 | 
			
		||||
      )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue