From 836a26bc558ee930e18954c19b62cbdeb5f73997 Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Tue, 19 Mar 2024 22:33:58 -0700 Subject: [PATCH] specs: add :needs_github_api for documentation --- Library/Homebrew/test/dev-cmd/audit_spec.rb | 18 +++++++++--------- Library/Homebrew/test/tap_spec.rb | 4 ++-- Library/Homebrew/test/utils/github_spec.rb | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index 4b8ea0b327df1f..34ed241bbcaa64 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -330,7 +330,7 @@ class Foo < Formula end it "checks online and verifies that a standard license id is the same " \ - "as what is indicated on its Github repo", :needs_network do + "as what is indicated on its Github repo", :needs_github_api, :needs_network do formula_text = <<~RUBY class Cask < Formula url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" @@ -346,7 +346,7 @@ class Cask < Formula end it "checks online and verifies that a standard license id with AND is the same " \ - "as what is indicated on its Github repo", :needs_network do + "as what is indicated on its Github repo", :needs_github_api, :needs_network do formula_text = <<~RUBY class Cask < Formula url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" @@ -362,7 +362,7 @@ class Cask < Formula end it "checks online and verifies that a standard license id with WITH is the same " \ - "as what is indicated on its Github repo", :needs_network do + "as what is indicated on its Github repo", :needs_github_api, :needs_network do formula_text = <<~RUBY class Cask < Formula url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" @@ -416,7 +416,7 @@ class Cask < Formula end it "checks online and verifies that a standard license id is in the same exempted license group " \ - "as what is indicated on its GitHub repo", :needs_network do + "as what is indicated on its GitHub repo", :needs_github_api, :needs_network do fa = formula_auditor "cask", <<~RUBY, spdx_license_data:, online: true, new_formula: true class Cask < Formula url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" @@ -430,7 +430,7 @@ class Cask < Formula end it "checks online and verifies that a standard license array is in the same exempted license group " \ - "as what is indicated on its GitHub repo", :needs_network do + "as what is indicated on its GitHub repo", :needs_github_api, :needs_network do fa = formula_auditor "cask", <<~RUBY, spdx_license_data:, online: true, new_formula: true class Cask < Formula url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" @@ -444,7 +444,7 @@ class Cask < Formula end it "checks online and detects that a formula-specified license is not " \ - "the same as what is indicated on its Github repository", :needs_network do + "the same as what is indicated on its Github repository", :needs_github_api, :needs_network do formula_text = <<~RUBY class Cask < Formula url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" @@ -461,7 +461,7 @@ class Cask < Formula end it "allows a formula-specified license that differs from its GitHub " \ - "repository for formulae on the mismatched license allowlist", :needs_network do + "repository for formulae on the mismatched license allowlist", :needs_github_api, :needs_network do formula_text = <<~RUBY class Cask < Formula url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" @@ -478,7 +478,7 @@ class Cask < Formula end it "checks online and detects that an array of license does not contain " \ - "what is indicated on its Github repository", :needs_network do + "what is indicated on its Github repository", :needs_github_api, :needs_network do formula_text = <<~RUBY class Cask < Formula url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" @@ -495,7 +495,7 @@ class Cask < Formula end it "checks online and verifies that an array of license contains " \ - "what is indicated on its Github repository", :needs_network do + "what is indicated on its Github repository", :needs_github_api, :needs_network do formula_text = <<~RUBY class Cask < Formula url "https://github.com/cask/cask/archive/v0.8.4.tar.gz" diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index ecfa2b8996aa3d..6f1c569e7e4d97 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -192,7 +192,7 @@ def setup_completion(link:) end describe "#remote" do - it "returns the remote URL", :needs_network do + it "returns the remote URL", :needs_github_api, :needs_network do setup_git_repo expect(homebrew_foo_tap.remote).to eq("https://github.com/Homebrew/homebrew-foo") @@ -297,7 +297,7 @@ def setup_completion(link:) expect(homebrew_foo_tap.git_last_commit).to match(/\A\d+ .+ ago\Z/) end - specify "#private?", :needs_network do + specify "#private?", :needs_github_api, :needs_network do expect(homebrew_foo_tap).to be_private end diff --git a/Library/Homebrew/test/utils/github_spec.rb b/Library/Homebrew/test/utils/github_spec.rb index c21a7ae6a48515..80575fc26d8ca2 100644 --- a/Library/Homebrew/test/utils/github_spec.rb +++ b/Library/Homebrew/test/utils/github_spec.rb @@ -20,7 +20,7 @@ end end - describe "::search_issues", :needs_network do + describe "::search_issues", :needs_github_api, :needs_network do it "queries GitHub issues with the passed parameters" do results = described_class.search_issues("brew search", repo: "Homebrew/legacy-homebrew", @@ -31,21 +31,21 @@ end end - describe "::approved_reviews", :needs_network do + describe "::approved_reviews", :needs_github_api, :needs_network do it "can get reviews for a pull request" do reviews = described_class.approved_reviews("Homebrew", "homebrew-core", 1, commit: "deadbeef") expect(reviews).to eq([]) end end - describe "::public_member_usernames", :needs_network do + describe "::public_member_usernames", :needs_github_api, :needs_network do it "gets the usernames of all publicly visible members of the organisation" do response = described_class.public_member_usernames("Homebrew") expect(response).to be_a(Array) end end - describe "::get_artifact_url", :needs_network do + describe "::get_artifact_url", :needs_github_api, :needs_network do it "fails to find a nonexistent workflow" do expect do described_class.get_artifact_url( @@ -72,7 +72,7 @@ end end - describe "::pull_request_commits", :needs_network do + describe "::pull_request_commits", :needs_github_api, :needs_network do hashes = %w[188606a4a9587365d930b02c98ad6857b1d00150 25a71fe1ea1558415d6496d23834dc70778ddee5] it "gets commit hashes for a pull request" do