@@ -715,34 +715,35 @@ class Foo < Formula
715
715
end
716
716
717
717
it "requires `branch:` to be specified for Git head URLs" do
718
- fa = formula_auditor "foo" , <<~RUBY
718
+ fa = formula_auditor "foo" , <<~RUBY , online : true
719
719
class Foo < Formula
720
720
url "https://brew.sh/foo-1.0.tgz"
721
721
sha256 "31cccfc6630528db1c8e3a06f6decf2a370060b982841cfab2b8677400a5092e"
722
- head "https://github.com/example/foo .git"
722
+ head "https://github.com/Homebrew/homebrew-test-bot .git"
723
723
end
724
724
RUBY
725
725
726
726
fa . audit_specs
727
- expect ( fa . problems . first [ :message ] ) . to match ( "Git `head` URL must specify a branch name" )
727
+ # This is `.last` because the first problem is the unreachable stable URL.
728
+ expect ( fa . problems . last [ :message ] ) . to match ( "Git `head` URL must specify a branch name" )
728
729
end
729
730
730
731
it "suggests a detected default branch for Git head URLs" do
731
732
fa = formula_auditor "foo" , <<~RUBY , online : true
732
733
class Foo < Formula
733
734
url "https://brew.sh/foo-1.0.tgz"
734
735
sha256 "31cccfc6630528db1c8e3a06f6decf2a370060b982841cfab2b8677400a5092e"
735
- head "https://github.com/Homebrew/homebrew-core .git", branch: "master"
736
+ head "https://github.com/Homebrew/homebrew-test-bot .git", branch: "master"
736
737
end
737
738
RUBY
738
739
739
740
fa . audit_specs
740
741
# This is `.last` because the first problem is the unreachable stable URL.
741
- expect ( fa . problems . last [ :message ] ) . to match ( 'Detected a default branch "main", not "master"' )
742
+ expect ( fa . problems . last [ :message ] ) . to match ( "Git `head` URL must specify a branch name - try ` branch: \ " main\" `" )
742
743
end
743
744
744
745
it "ignores `branch:` for non-Git head URLs" do
745
- fa = formula_auditor "foo" , <<~RUBY
746
+ fa = formula_auditor "foo" , <<~RUBY , online : true
746
747
class Foo < Formula
747
748
url "https://brew.sh/foo-1.0.tgz"
748
749
sha256 "31cccfc6630528db1c8e3a06f6decf2a370060b982841cfab2b8677400a5092e"
@@ -755,7 +756,7 @@ class Foo < Formula
755
756
end
756
757
757
758
it "ignores `branch:` for `resource` URLs" do
758
- fa = formula_auditor "foo" , <<~RUBY
759
+ fa = formula_auditor "foo" , <<~RUBY , online : true
759
760
class Foo < Formula
760
761
url "https://brew.sh/foo-1.0.tgz"
761
762
sha256 "31cccfc6630528db1c8e3a06f6decf2a370060b982841cfab2b8677400a5092e"
@@ -768,7 +769,7 @@ class Foo < Formula
768
769
RUBY
769
770
770
771
fa . audit_specs
771
- expect ( fa . problems ) . to be_empty
772
+ expect ( fa . problems ) . not_to match ( "Git `head` URL must specify a branch name" )
772
773
end
773
774
774
775
it "allows versions with no throttle rate" do
0 commit comments