components_order and test
This commit is contained in:
parent
fb4db63e3b
commit
1422542a07
@ -24,6 +24,7 @@ module RuboCop
|
||||
[{ name: :mirror, type: :method_call }],
|
||||
[{ name: :version, type: :method_call }],
|
||||
[{ name: :sha256, type: :method_call }],
|
||||
[{ name: :license, type: :method_call }],
|
||||
[{ name: :revision, type: :method_call }],
|
||||
[{ name: :version_scheme, type: :method_call }],
|
||||
[{ name: :head, type: :method_call }],
|
||||
|
||||
@ -19,6 +19,19 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do
|
||||
RUBY
|
||||
end
|
||||
|
||||
it "When license precedes sha256" do
|
||||
expect_offense(<<~RUBY)
|
||||
class Foo < Formula
|
||||
homepage "https://brew.sh"
|
||||
url "https://brew.sh/foo-1.0.tgz"
|
||||
license "0BSD"
|
||||
sha256 "samplesha256"
|
||||
^^^^^^^^^^^^^^^^^^^^^ `sha256` (line 5) should be put before `license` (line 4)
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
|
||||
|
||||
it "When `bottle` precedes `livecheck`" do
|
||||
expect_offense(<<~RUBY)
|
||||
class Foo < Formula
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user