mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	
							parent
							
								
									d7b0e10d1e
								
							
						
					
					
						commit
						12aa48c98f
					
				
					 2 changed files with 14 additions and 1 deletions
				
			
		| 
						 | 
					@ -192,6 +192,19 @@ module Ameba::Rule::Style
 | 
				
			||||||
      subject.catch(s).should_not be_valid
 | 
					      subject.catch(s).should_not be_valid
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    it "doesn't report if begin-end block in a proc literal" do
 | 
				
			||||||
 | 
					      s = Source.new %q(
 | 
				
			||||||
 | 
					        foo = ->{
 | 
				
			||||||
 | 
					          begin
 | 
				
			||||||
 | 
					            raise "Foo!"
 | 
				
			||||||
 | 
					          rescue ex
 | 
				
			||||||
 | 
					            pp ex
 | 
				
			||||||
 | 
					          end
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      )
 | 
				
			||||||
 | 
					      subject.catch(s).should be_valid
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it "reports rule, pos and message" do
 | 
					    it "reports rule, pos and message" do
 | 
				
			||||||
      s = Source.new %q(
 | 
					      s = Source.new %q(
 | 
				
			||||||
        def method
 | 
					        def method
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -113,7 +113,7 @@ module Ameba::Rule::Style
 | 
				
			||||||
        token = lexer.next_token
 | 
					        token = lexer.next_token
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case token.type
 | 
					        case token.type
 | 
				
			||||||
        when :EOF
 | 
					        when :EOF, :"->"
 | 
				
			||||||
          break
 | 
					          break
 | 
				
			||||||
        when :IDENT
 | 
					        when :IDENT
 | 
				
			||||||
          return token.value == :begin if in_body?
 | 
					          return token.value == :begin if in_body?
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue