From ca52eee2adbdf272b6f08953e5fe111667df7686 Mon Sep 17 00:00:00 2001 From: JCount Date: Sun, 8 Oct 2017 21:46:32 -0400 Subject: [PATCH] lines_cop_spec: add test for ENV.universal_binary audit exemption for wine --- .../Homebrew/test/rubocops/lines_cop_spec.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/test/rubocops/lines_cop_spec.rb b/Library/Homebrew/test/rubocops/lines_cop_spec.rb index 753439c8e2..e798db9e39 100644 --- a/Library/Homebrew/test/rubocops/lines_cop_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_cop_spec.rb @@ -419,7 +419,22 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do end end - it "with ENV.universal_binary" do + it "with ENV.universal_binary exempted formula" do + source = <<-EOS.undent + class Wine < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + if build? + ENV.universal_binary + end + end + EOS + + inspect_source(source, "/homebrew-core/Formula/wine.rb") + expect(cop.offenses).to eq([]) + end + + it "with ENV.x11" do source = <<-EOS.undent class Foo < Formula desc "foo"