Ignore empty patch blocks
				
					
				
			This commit is contained in:
		
							parent
							
								
									f96b9ef535
								
							
						
					
					
						commit
						94138c0848
					
				@ -205,6 +205,8 @@ class SoftwareSpec
 | 
			
		||||
 | 
			
		||||
  def patch(strip = :p1, src = nil, &block)
 | 
			
		||||
    p = Patch.create(strip, src, &block)
 | 
			
		||||
    return if p.is_a?(ExternalPatch) && p.url.blank?
 | 
			
		||||
 | 
			
		||||
    dependency_collector.add(p.resource) if p.is_a? ExternalPatch
 | 
			
		||||
    patches << p
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
@ -171,5 +171,12 @@ describe SoftwareSpec do
 | 
			
		||||
      expect(spec.patches.count).to eq(1)
 | 
			
		||||
      expect(spec.patches.first.strip).to eq(:p1)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "doesn't add a patch with no url" do
 | 
			
		||||
      spec.patch do
 | 
			
		||||
        sha256 "7852a7a365f518b12a1afd763a6a80ece88ac7aeea3c9023aa6c1fe46ac5a1ae"
 | 
			
		||||
      end
 | 
			
		||||
      expect(spec.patches.empty?).to be true
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user