From fdb2406b2044d74fb28ea7844b0987c8fb9feb20 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 11 Jun 2018 04:21:02 +0200 Subject: [PATCH] Add failing spec for `DependencyOrder` cop. --- .../test/rubocops/dependency_order_cop_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb b/Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb index cc5b0460a5..f2c6a66f1e 100644 --- a/Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/dependency_order_cop_spec.rb @@ -28,6 +28,18 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do RUBY 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 expect_offense(<<~RUBY) class Foo < Formula