mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Prevent disabling of UnneededDisableDirective rule
This commit is contained in:
		
							parent
							
								
									8075c39aa9
								
							
						
					
					
						commit
						6fb483a2dd
					
				
					 4 changed files with 18 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -65,6 +65,15 @@ module Ameba::Rule
 | 
			
		|||
      s.errors.last.message.should contain "Rule3"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "fails if there is disabled UnneededDisableDirective" do
 | 
			
		||||
      s = Source.new %Q(
 | 
			
		||||
        # ameba:disable #{UnneededDisableDirective.class_name}
 | 
			
		||||
        a = 1
 | 
			
		||||
      ), "source.cr"
 | 
			
		||||
      s.error UnneededDisableDirective.new, 3, 1, "Alarm!", :disabled
 | 
			
		||||
      subject.catch(s).should_not be_valid
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "reports error, location and message" do
 | 
			
		||||
      s = Source.new %Q(
 | 
			
		||||
        # ameba:disable Rule1, Rule2
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue