From d0998a4907f96d7d85f6efb812bc5a11d71f68a5 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Thu, 21 Jan 2016 13:05:14 +0100 Subject: [PATCH] testing_env: needs_compat utility added Closes Homebrew/homebrew#48302. Signed-off-by: Baptiste Fontaine --- Library/Homebrew/test/test_cmd_audit.rb | 9 +++++++++ Library/Homebrew/test/testing_env.rb | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/Library/Homebrew/test/test_cmd_audit.rb b/Library/Homebrew/test/test_cmd_audit.rb index 20df333baa..16c0426edf 100644 --- a/Library/Homebrew/test/test_cmd_audit.rb +++ b/Library/Homebrew/test/test_cmd_audit.rb @@ -216,6 +216,9 @@ class FormulaAuditorTests < Homebrew::TestCase end def test_audit_class_github_gist_formula + needs_compat + require "compat/formula_specialties" + fa = formula_auditor "foo", <<-EOS.undent class Foo < GithubGistFormula url "http://example.com/foo-1.0.tgz" @@ -227,6 +230,9 @@ class FormulaAuditorTests < Homebrew::TestCase end def test_audit_class_script_file_formula + needs_compat + require "compat/formula_specialties" + fa = formula_auditor "foo", <<-EOS.undent class Foo < ScriptFileFormula url "http://example.com/foo-1.0.tgz" @@ -238,6 +244,9 @@ class FormulaAuditorTests < Homebrew::TestCase end def test_audit_class_aws_formula + needs_compat + require "compat/formula_specialties" + fa = formula_auditor "foo", <<-EOS.undent class Foo < AmazonWebServicesFormula url "http://example.com/foo-1.0.tgz" diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb index bca841f7f3..2aaf20c3f0 100644 --- a/Library/Homebrew/test/testing_env.rb +++ b/Library/Homebrew/test/testing_env.rb @@ -93,6 +93,10 @@ module Homebrew Dir.mktmpdir(prefix_suffix, HOMEBREW_TEMP, &block) end + def needs_compat + skip "Requires compat/ code" if ENV["HOMEBREW_NO_COMPAT"] + end + def assert_nothing_raised yield end