| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-26 19:41:14 +01:00
										 |  |  | require "rubocops/lines" | 
					
						
							| 
									
										
										
										
											2017-07-29 16:36:32 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-18 15:11:11 -08:00
										 |  |  | RSpec.describe RuboCop::Cop::FormulaAudit::Lines do | 
					
						
							| 
									
										
										
										
											2017-07-29 16:36:32 +05:30
										 |  |  |   subject(:cop) { described_class.new } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |   context "when auditing deprecated special dependencies" do | 
					
						
							|  |  |  |     it "reports an offense when using depends_on :automake" do | 
					
						
							|  |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url 'https://brew.sh/foo-1.0.tgz' | 
					
						
							|  |  |  |           depends_on :automake | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |           ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Lines: :automake is deprecated. Usage should be "automake". | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2017-07-29 16:36:32 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |     it "reports an offense when using depends_on :autoconf" do | 
					
						
							|  |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url 'https://brew.sh/foo-1.0.tgz' | 
					
						
							|  |  |  |           depends_on :autoconf | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |           ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Lines: :autoconf is deprecated. Usage should be "autoconf". | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2017-07-29 16:36:32 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |     it "reports an offense when using depends_on :libtool" do | 
					
						
							|  |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url 'https://brew.sh/foo-1.0.tgz' | 
					
						
							|  |  |  |           depends_on :libtool | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |           ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Lines: :libtool is deprecated. Usage should be "libtool". | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |     it "reports an offense when using depends_on :apr" do | 
					
						
							|  |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url 'https://brew.sh/foo-1.0.tgz' | 
					
						
							|  |  |  |           depends_on :apr | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |           ^^^^^^^^^^^^^^^ FormulaAudit/Lines: :apr is deprecated. Usage should be "apr-util". | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |     it "reports an offense when using depends_on :tex" do | 
					
						
							|  |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url 'https://brew.sh/foo-1.0.tgz' | 
					
						
							|  |  |  |           depends_on :tex | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |           ^^^^^^^^^^^^^^^ FormulaAudit/Lines: :tex is deprecated. | 
					
						
							| 
									
										
										
										
											2021-01-12 02:21:51 +11:00
										 |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2017-07-29 16:36:32 +05:30
										 |  |  |   end | 
					
						
							|  |  |  | end |