Add failing spec for DependencyOrder cop.

This commit is contained in:
Markus Reiter 2018-06-11 04:21:02 +02:00
parent 6e519fc733
commit fdb2406b20

View File

@ -28,6 +28,18 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do
RUBY RUBY
end end
it "supports requirement constants" do
expect_offense(<<~RUBY)
class Foo < Formula
homepage "http://example.com"
url "http://example.com/foo-1.0.tgz"
depends_on FooRequirement
depends_on "bar"
^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "FooRequirement" (line 4)
end
RUBY
end
it "wrong conditional depends_on order" do it "wrong conditional depends_on order" do
expect_offense(<<~RUBY) expect_offense(<<~RUBY)
class Foo < Formula class Foo < Formula