From ce7ab823ed5b93ae4588e754c3cc64974c0882f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20=C3=81lvaro?= Date: Sun, 7 Feb 2021 19:07:54 +0100 Subject: [PATCH] Replace test for checking formulae tap As suggested by @Rylan12, integration tests are super slow. Co-Authored-By: Rylan Polster --- Library/Homebrew/test/cmd/info_spec.rb | 20 -------------------- Library/Homebrew/test/formula_spec.rb | 1 + 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/Library/Homebrew/test/cmd/info_spec.rb b/Library/Homebrew/test/cmd/info_spec.rb index aaadf55297..9189b106d9 100644 --- a/Library/Homebrew/test/cmd/info_spec.rb +++ b/Library/Homebrew/test/cmd/info_spec.rb @@ -6,19 +6,6 @@ require "cmd/info" require "cmd/shared_examples/args_parse" describe "brew info" do - let(:tarball) do - if OS.linux? - TEST_FIXTURE_DIR/"tarballs/testball-0.1-linux.tbz" - else - TEST_FIXTURE_DIR/"tarballs/testball-0.1.tbz" - end - end - let(:expected_output) { - <<~EOS - {"formulae":[{"name":"testball","full_name":"testball","tap":"homebrew/core","oldname":null,"aliases":[],"versioned_formulae":[],"desc":"Some test","license":null,"homepage":"https://brew.sh/testball","versions":{"stable":"0.1","head":null,"bottle":false},"urls":{"stable":{"url":"file://#{tarball}","tag":null,"revision":null}},"revision":0,"version_scheme":0,"bottle":{},"keg_only":false,"bottle_disabled":false,"options":[{"option":"--with-foo","description":"Build with foo"}],"build_dependencies":[],"dependencies":[],"recommended_dependencies":[],"optional_dependencies":[],"uses_from_macos":[],"requirements":[],"conflicts_with":[],"caveats":null,"installed":[],"linked_keg":null,"pinned":false,"outdated":false,"deprecated":false,"deprecation_date":null,"deprecation_reason":null,"disabled":false,"disable_date":null,"disable_reason":null}],"casks":[]} - EOS - } - it_behaves_like "parseable arguments" it "prints as json with the --json=v1 flag", :integration_test do @@ -39,13 +26,6 @@ describe "brew info" do .and be_a_success end - it "check --json=v2 format", :integration_test do - setup_test_formula "testball" - - expect { brew "info", "testball", "--json=v2" } - .to output(expected_output).to_stdout - end - describe Homebrew do describe "::github_remote_path" do let(:remote) { "https://github.com/Homebrew/homebrew-core" } diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index 54e497b13c..0148bb4158 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -838,6 +838,7 @@ describe Formula do expect(h).to be_a(Hash) expect(h["name"]).to eq("foo") expect(h["full_name"]).to eq("foo") + expect(h["tap"]).to eq("homebrew/core") expect(h["versions"]["stable"]).to eq("1.0") expect(h["versions"]["bottle"]).to be_truthy end