mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Do not report unused block arguments in Lint/UnusedArgument rule
				
					
				
			This commit is contained in:
		
							parent
							
								
									858557bc07
								
							
						
					
					
						commit
						7f6bd2289e
					
				
					 2 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -115,21 +115,21 @@ module Ameba::Rule::Lint
 | 
			
		|||
      subject.catch(s).should be_valid
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "reports if block arg is not used" do
 | 
			
		||||
    it "doesn't report if block arg is not used" do
 | 
			
		||||
      s = Source.new %(
 | 
			
		||||
        def method(&block)
 | 
			
		||||
        end
 | 
			
		||||
      )
 | 
			
		||||
      subject.catch(s).should_not be_valid
 | 
			
		||||
      subject.catch(s).should be_valid
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "reports if unused and there is yield" do
 | 
			
		||||
    it "doesn't report if unused and there is yield" do
 | 
			
		||||
      s = Source.new %(
 | 
			
		||||
        def method(&block)
 | 
			
		||||
          yield 1
 | 
			
		||||
        end
 | 
			
		||||
      )
 | 
			
		||||
      subject.catch(s).should_not be_valid
 | 
			
		||||
      subject.catch(s).should be_valid
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "doesn't report if it's an anonymous block" do
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue