| 
									
										
										
										
											2017-05-22 13:09:49 +05:30
										 |  |  | require_relative "../../rubocops/caveats_cop" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | describe RuboCop::Cop::FormulaAudit::Caveats do | 
					
						
							|  |  |  |   subject(:cop) { described_class.new } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   context "When auditing caveats" do | 
					
						
							|  |  |  |     it "When there is setuid mentioned in caveats" do | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							| 
									
										
										
										
											2017-10-15 02:28:32 +02:00
										 |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           homepage "http://example.com/foo" | 
					
						
							|  |  |  |           url "http://example.com/foo-1.0.tgz" | 
					
						
							|  |  |  |            def caveats | 
					
						
							|  |  |  |             "setuid" | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |              ^^^^^^ Don\'t recommend setuid in the caveats, suggest sudo instead. | 
					
						
							| 
									
										
										
										
											2017-10-15 02:28:32 +02:00
										 |  |  |           end | 
					
						
							| 
									
										
										
										
											2017-05-22 13:09:49 +05:30
										 |  |  |         end | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2017-05-22 13:09:49 +05:30
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |