2020-10-10 14:16:11 +02:00
|
|
|
# typed: false
|
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
|
|
|
|
|
|
|
describe RuboCop::Cop::FormulaAudit::Lines do
|
|
|
|
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
|
2022-12-13 10:54:22 +00:00
|
|
|
^^^^^^^^^^^^^^^^^^^^ :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
|
2022-12-13 10:54:22 +00:00
|
|
|
^^^^^^^^^^^^^^^^^^^^ :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
|
2022-12-13 10:54:22 +00:00
|
|
|
^^^^^^^^^^^^^^^^^^^ :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
|
2022-12-13 10:54:22 +00:00
|
|
|
^^^^^^^^^^^^^^^ :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
|
|
|
|
^^^^^^^^^^^^^^^ :tex is deprecated.
|
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
end
|
2017-07-29 16:36:32 +05:30
|
|
|
end
|
|
|
|
end
|