diff --git a/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb b/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb index 1426677483..cc03354e23 100644 --- a/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb +++ b/Library/Homebrew/test/api/internal_tap_json/formula_spec.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true RSpec.describe "Internal Tap JSON -- Formula" do + include FileUtils + let(:internal_tap_json) { File.read(TEST_FIXTURE_DIR/"internal_tap_json/homebrew-core.json").chomp } let(:tap_git_head) { "9977471165641744a829d3e494fa563407503297" } diff --git a/Library/Homebrew/test/cmd/deps_spec.rb b/Library/Homebrew/test/cmd/deps_spec.rb index aa6277196b..e7e19faa01 100644 --- a/Library/Homebrew/test/cmd/deps_spec.rb +++ b/Library/Homebrew/test/cmd/deps_spec.rb @@ -3,6 +3,8 @@ require "cmd/shared_examples/args_parse" RSpec.describe "brew deps" do + include FileUtils + it_behaves_like "parseable arguments" it "outputs all of a Formula's dependencies and their dependencies on separate lines", :integration_test do diff --git a/Library/Homebrew/test/cmd/uses_spec.rb b/Library/Homebrew/test/cmd/uses_spec.rb index 3495adca0a..6c1b864235 100644 --- a/Library/Homebrew/test/cmd/uses_spec.rb +++ b/Library/Homebrew/test/cmd/uses_spec.rb @@ -3,6 +3,8 @@ require "cmd/shared_examples/args_parse" RSpec.describe "brew uses" do + include FileUtils + it_behaves_like "parseable arguments" it "prints the Formulae a given Formula is used by", :integration_test do diff --git a/Library/Homebrew/test/dev-cmd/pr-pull_spec.rb b/Library/Homebrew/test/dev-cmd/pr-pull_spec.rb index 422c9ea485..8850c1cb98 100644 --- a/Library/Homebrew/test/dev-cmd/pr-pull_spec.rb +++ b/Library/Homebrew/test/dev-cmd/pr-pull_spec.rb @@ -6,6 +6,8 @@ require "tap" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::DevCmd::PrPull do + include FileUtils + let(:pr_pull) { described_class.new(["foo"]) } let(:formula_rebuild) do <<~EOS diff --git a/Library/Homebrew/test/formula_auditor_spec.rb b/Library/Homebrew/test/formula_auditor_spec.rb index 1270a266c2..f25a1920e2 100644 --- a/Library/Homebrew/test/formula_auditor_spec.rb +++ b/Library/Homebrew/test/formula_auditor_spec.rb @@ -3,6 +3,8 @@ require "formula_auditor" RSpec.describe Homebrew::FormulaAuditor do + include FileUtils + let(:dir) { mktmpdir } let(:foo_version) do @count ||= 0 diff --git a/Library/Homebrew/test/keg_spec.rb b/Library/Homebrew/test/keg_spec.rb index 5231fe619f..d7f6d804b6 100644 --- a/Library/Homebrew/test/keg_spec.rb +++ b/Library/Homebrew/test/keg_spec.rb @@ -4,6 +4,8 @@ require "keg" require "stringio" RSpec.describe Keg do + include FileUtils + def setup_test_keg(name, version) path = HOMEBREW_CELLAR/name/version (path/"bin").mkpath diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index f6ce098f5d..141bee02f7 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -128,8 +128,6 @@ RSpec.configure do |config| # Never truncate output objects. RSpec::Support::ObjectFormatter.default_instance.max_formatted_output_length = nil - config.include(FileUtils) - config.include(RuboCop::RSpec::ExpectOffense) config.include(Test::Helper::Cask) diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index ecfa2b8996..2a87f189df 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true RSpec.describe Tap do + include FileUtils + alias_matcher :have_formula_file, :be_formula_file alias_matcher :have_custom_remote, :be_custom_remote diff --git a/Library/Homebrew/test/utils/gzip_spec.rb b/Library/Homebrew/test/utils/gzip_spec.rb index 59540a1675..4679a15e1e 100644 --- a/Library/Homebrew/test/utils/gzip_spec.rb +++ b/Library/Homebrew/test/utils/gzip_spec.rb @@ -3,6 +3,8 @@ require "utils/gzip" RSpec.describe Utils::Gzip do + include FileUtils + describe "compress_with_options" do it "uses the explicitly specified mtime, orig_name, and output path when passed" do mktmpdir do |path|