repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/with-allow-untrusted.rb
Library/Homebrew/test/support/fixtures/cask/Casks/with-allow-untrusted.rb
cask "with-allow-untrusted" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" homepage "https://brew.sh/fancy-pkg" pkg "Fancy.pkg", allow_untrusted: true uninstall pkgutil: "my.fancy.package.*" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb
Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb
cask "with-depends-on-macos-failure" do # guarantee a mismatched release on_big_sur :or_older do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" end on_ventura :or_newer do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" end url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/with-depends-on-macos-failure" depends_on macos: :monterey app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-pkgutil.rb
Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-pkgutil.rb
cask "with-zap-pkgutil" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" homepage "https://brew.sh/fancy-pkg" pkg "Fancy.pkg" zap pkgutil: "my.fancy.package.*" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-cyclic.rb
Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-cyclic.rb
cask "with-depends-on-cask-cyclic" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/with-depends-on-cask-cyclic" depends_on cask: "local-caffeine" depends_on cask: "with-depends-on-cask-cyclic-helper" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/container-7z.rb
Library/Homebrew/test/support/fixtures/cask/Casks/container-7z.rb
cask "container-7z" do version "1.2.3" sha256 "3f9542ace85ed5f88549e2d0ea82210f8ddc87e0defbb78469d3aed719b3c964" url "file://#{TEST_FIXTURE_DIR}/cask/container.7z" homepage "https://brew.sh/container-7z" depends_on formula: "unar" app "container" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/version-latest-with-checksum.rb
Library/Homebrew/test/support/fixtures/cask/Casks/version-latest-with-checksum.rb
cask "version-latest-with-checksum" do version :latest sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-correct.rb
Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-correct.rb
cask "with-two-apps-correct" do version "1.2.3" sha256 "3178fbfd1ea5d87a2a0662a4eb599ebc9a03888e73f37538d9f3f6ee69d2368e" url "file://#{TEST_FIXTURE_DIR}/cask/caffeines.zip" homepage "https://brew.sh/" app "Caffeine Mini.app" app "Caffeine Pro.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-signal.rb
Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-signal.rb
cask "with-zap-signal" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" homepage "https://brew.sh/fancy-pkg" pkg "MyFancyPkg/Fancy.pkg" zap signal: [ ["TERM", "my.fancy.package.app"], ["KILL", "my.fancy.package.app"], ] end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-launchctl-wildcard.rb
Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-launchctl-wildcard.rb
cask "with-uninstall-launchctl-wildcard" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyApp.zip" homepage "https://brew.sh/fancy" app "Fancy.app" uninstall launchctl: "my.fancy.package.service.*" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/with-shellcompletion.rb
Library/Homebrew/test/support/fixtures/cask/Casks/with-shellcompletion.rb
cask "with-shellcompletion" do version "1.2.3" sha256 "957978d9b30adfda8e1f914ba8c8019e016545c8f7e16c6ab0234d189fac8146" url "file://#{TEST_FIXTURE_DIR}/cask/AppWithShellCompletion.zip" homepage "https://brew.sh/with-autodetected-manpage-section" bash_completion "test.bash" fish_completion "test.fish" zsh_completion "_test" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/local-transmission-zip.rb
Library/Homebrew/test/support/fixtures/cask/Casks/local-transmission-zip.rb
cask "local-transmission-zip" do version "2.61" sha256 "5e96aeb365aa8fabd51bb0d85f5f2bfe0135d392bb2f4120aa6b8171415906da" url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.zip" name "Transmission" desc "BitTorrent client" homepage "https://transmissionbt.com/" app "Transmission.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/local-caffeine.rb
Library/Homebrew/test/support/fixtures/cask/Casks/local-caffeine.rb
cask "local-caffeine" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" app "Caffeine.app" zap trash: "#{TEST_FIXTURE_DIR}/cask/caffeine/org.example.caffeine.plist" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/latest.rb
Library/Homebrew/test/support/fixtures/cask/Casks/latest.rb
cask "latest" do version :latest sha256 :no_check url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/with-appcast" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/sha256-os.rb
Library/Homebrew/test/support/fixtures/cask/Casks/sha256-os.rb
cask "sha256-os" do arch arm: "arm", intel: "intel" os macos: "darwin", linux: "linux" version "1.2.3" sha256 arm: "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94", intel: "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b", x86_64_linux: "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b", arm64_linux: "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine-#{arch}-#{os}.zip" homepage "https://brew.sh/" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-signal.rb
Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-signal.rb
cask "with-uninstall-signal" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" homepage "https://brew.sh/fancy-pkg" pkg "MyFancyPkg/Fancy.pkg" uninstall signal: [ ["TERM", "my.fancy.package.app"], ["KILL", "my.fancy.package.app"], ] end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/compat/with-depends-on-macos-string.rb
Library/Homebrew/test/support/fixtures/cask/Casks/compat/with-depends-on-macos-string.rb
cask "with-depends-on-macos-string" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/with-depends-on-macos-string" depends_on macos: MacOS.version.to_s app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-version-latest.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-version-latest.rb
cask "livecheck-version-latest" do version :latest sha256 :no_check # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/version-latest.dmg" name "Version Latest" desc "Cask for testing a latest version in livecheck" homepage "http://localhost/homebrew/test/cask/audit/livecheck/version-latest" app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-installer-manual.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-installer-manual.rb
cask "livecheck-installer-manual" do version "1.2.3" sha256 "78c670559a609f5d89a5d75eee49e2a2dab48aa3ea36906d14d5f7104e483bb9" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine-incl-plist.zip" name "With Installer Manual" desc "Cask with a manual installer" homepage "https://brew.sh/" livecheck do url :url strategy :extract_plist end installer manual: "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-disabled-reference.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-disabled-reference.rb
cask "livecheck-disabled-reference" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/disabled-#{version}.dmg" name "Disabled Reference" desc "Cask for testing a livecheck reference to a disabled cask" homepage "http://localhost/homebrew/test/cask/audit/livecheck/disabled" livecheck do cask "livecheck-disabled" end app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-deprecated.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-deprecated.rb
cask "livecheck-deprecated" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/deprecated-#{version}.dmg" name "Deprecated" desc "Cask for testing deprecated in livecheck" homepage "http://localhost/homebrew/test/cask/audit/livecheck/deprecated" deprecate! date: "2023-01-01", because: :discontinued app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-skip-reference.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-skip-reference.rb
cask "livecheck-skip-reference" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/livecheck-skip-#{version}.dmg" name "Skip Reference" desc "Cask for testing a livecheck reference to a cask with a #skip livecheck block" homepage "http://localhost/homebrew/test/cask/audit/livecheck/livecheck-skip" livecheck do cask "livecheck-skip" end app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-url-unversioned-reference.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-url-unversioned-reference.rb
cask "livecheck-url-unversioned-reference" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/url-unversioned.dmg" name "Unversioned URL Reference" desc "Cask for testing a livecheck reference to a cask with an unversioned URL" homepage "http://localhost/homebrew/test/cask/audit/livecheck/url-unversioned" livecheck do cask "livecheck-url-unversioned" end app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-deprecated-reference.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-deprecated-reference.rb
cask "livecheck-deprecated-reference" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/deprecated-#{version}.dmg" name "Deprecated Reference" desc "Cask for testing a livecheck reference to a deprecated cask" homepage "http://localhost/homebrew/test/cask/audit/livecheck/deprecated" livecheck do cask "livecheck-deprecated" end app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-skip.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-skip.rb
cask "livecheck-skip" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/livecheck-skip-#{version}.dmg" name "Skip" desc "Cask for testing skip in a livecheck block" homepage "http://localhost/homebrew/test/cask/audit/livecheck/livecheck-skip" livecheck do skip "No version information available to check" end app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-disabled.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-disabled.rb
cask "livecheck-disabled" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/disabled-#{version}.dmg" name "Disabled" desc "Cask for testing disabled in livecheck" homepage "http://localhost/homebrew/test/cask/audit/livecheck/disabled" disable! date: "2023-01-01", because: :discontinued app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-url-unversioned.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-url-unversioned.rb
cask "livecheck-url-unversioned" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/url-unversioned.dmg" name "Unversioned URL" desc "Cask for testing an unversioned URL in livecheck" homepage "http://localhost/homebrew/test/cask/audit/livecheck/url-unversioned" app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-extract-plist.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-extract-plist.rb
cask "livecheck-extract-plist" do version "1.2.3" sha256 "78c670559a609f5d89a5d75eee49e2a2dab48aa3ea36906d14d5f7104e483bb9" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine-suite.zip" name "With Extract Plist Livecheck" desc "Cask with a an ExtractPlist livecheck strategy" homepage "https://brew.sh/" livecheck do url "file://#{TEST_FIXTURE_DIR}/cask/caffeine-with-plist.zip" strategy :extract_plist end app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-version-latest-reference.rb
Library/Homebrew/test/support/fixtures/cask/Casks/livecheck/livecheck-version-latest-reference.rb
cask "livecheck-version-latest-reference" do version :latest sha256 :no_check # This cask is used in --online tests, so we use fake URLs to avoid impacting # real servers. The URL paths are specific enough that they'll be # understandable if they appear in local server logs. url "http://localhost/homebrew/test/cask/audit/livecheck/version-latest.dmg" name "Version Latest Reference" desc "Cask for testing a livecheck reference to a cask where version is :latest" homepage "http://localhost/homebrew/test/cask/audit/livecheck/version-latest" livecheck do cask "livecheck-version-latest" end app "TestCask.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-bad-release.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-bad-release.rb
cask "invalid-depends-on-macos-bad-release" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/invalid-depends-on-macos-bad-release" depends_on macos: :no_such_release app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-conflicting-forms.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-conflicting-forms.rb
# frozen_string_literal: true cask "invalid-depends-on-macos-conflicting-forms" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/invalid-depends-on-macos-conflicting-forms" depends_on macos: :sequoia depends_on macos: ">= :sonoma" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-homepage.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-homepage.rb
cask "invalid-two-homepage" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" homepage "https://www.brew.sh/local-caffeine" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-version.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-version.rb
cask "invalid-header-version" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-stage-only-conflict.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-stage-only-conflict.rb
cask "invalid-stage-only-conflict" do version "2.61" sha256 "e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68" url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.dmg" homepage "https://brew.sh/invalid-stage-only-conflict" app "Transmission.app" stage_only true end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-url.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-url.rb
cask "invalid-two-url" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" url "https://brew.sh/caffeine.zip" homepage "https://brew.sh/" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-generic-artifact-no-target.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-generic-artifact-no-target.rb
cask "invalid-generic-artifact-no-target" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/with-generic-artifact" artifact "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-token-mismatch.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-token-mismatch.rb
cask "invalid-header-token-mismatch-this-text-does-not-belong" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/conflicts-with-disabled-key.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/conflicts-with-disabled-key.rb
cask "conflicts-with-disabled-key" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/conflicts-with-disabled-key" conflicts_with formula: "some-formula" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-arch-value.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-arch-value.rb
cask "invalid-depends-on-arch-value" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/invalid-depends-on-arch-value" depends_on arch: :no_such_arch app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-manpage-no-section.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-manpage-no-section.rb
cask "invalid-manpage-no-section" do version "1.2.3" sha256 "68b7e71a2ca7585b004f52652749589941e3029ff0884e8aa3b099594e0282c0" url "file://#{TEST_FIXTURE_DIR}/cask/AppWithManpage.zip" homepage "https://brew.sh/with-generic-artifact" manpage "manpage" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-format.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-format.rb
cask "invalid-header-format", :invalid do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-conflicts-with-key.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-conflicts-with-key.rb
cask "invalid-conflicts-with-key" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/invalid-conflicts-with-key" conflicts_with no_such_key: "unar" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-key.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-key.rb
cask "invalid-depends-on-key" do version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/invalid-depends-on-key" depends_on no_such_key: "unar" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-arch.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-arch.rb
cask "invalid-two-arch" do arch arm: "arm", intel: "intel" arch arm: "amd64", intel: "x86_64" version "1.2.3" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-version.rb
Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-version.rb
cask "invalid-two-version" do version "1.2.3" version "2.0" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/outdated/auto-updates.rb
Library/Homebrew/test/support/fixtures/cask/Casks/outdated/auto-updates.rb
cask "auto-updates" do version "2.57" sha256 "5633c3a0f2e572cbf021507dec78c50998b398c343232bdfc7e26221d0a5db4d" url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyApp.zip" homepage "https://brew.sh/MyFancyApp" auto_updates true app "MyFancyApp/MyFancyApp.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/outdated/will-fail-if-upgraded.rb
Library/Homebrew/test/support/fixtures/cask/Casks/outdated/will-fail-if-upgraded.rb
cask "will-fail-if-upgraded" do version "1.2.2" sha256 "fab685fabf73d5a9382581ce8698fce9408f5feaa49fa10d9bc6c510493300f5" url "file://#{TEST_FIXTURE_DIR}/cask/container.tar.gz" homepage "https://brew.sh/container-tar-gz" app "container" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/outdated/local-transmission.rb
Library/Homebrew/test/support/fixtures/cask/Casks/outdated/local-transmission.rb
cask "local-transmission" do version "2.60" sha256 "e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68" url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.dmg" homepage "https://brew.sh/" app "Transmission.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/outdated/bad-checksum.rb
Library/Homebrew/test/support/fixtures/cask/Casks/outdated/bad-checksum.rb
cask "bad-checksum" do version "1.2.2" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/outdated/renamed-app.rb
Library/Homebrew/test/support/fixtures/cask/Casks/outdated/renamed-app.rb
cask "renamed-app" do version "1.0.0" sha256 "cf001ed6c81820e049dc7a353957dab8936b91f1956ee74ff0b3eb59791f1ad9" url "file://#{TEST_FIXTURE_DIR}/cask/old-app.tar.gz" homepage "https://brew.sh/" app "OldApp.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/outdated/version-latest.rb
Library/Homebrew/test/support/fixtures/cask/Casks/outdated/version-latest.rb
cask "version-latest" do version :latest sha256 :no_check url "file://#{TEST_FIXTURE_DIR}/cask/caffeines.zip" homepage "https://brew.sh/" app "Caffeine Mini.app" app "Caffeine Pro.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/outdated/bad-checksum2.rb
Library/Homebrew/test/support/fixtures/cask/Casks/outdated/bad-checksum2.rb
cask "bad-checksum2" do version "1.2.2" sha256 "fab685fabf73d5a9382581ce8698fce9408f5feaa49fa10d9bc6c510493300f5" url "file://#{TEST_FIXTURE_DIR}/cask/container.tar.gz" homepage "https://brew.sh/container-tar-gz" app "container" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/outdated/local-transmission-zip.rb
Library/Homebrew/test/support/fixtures/cask/Casks/outdated/local-transmission-zip.rb
cask "local-transmission-zip" do version "2.60" sha256 "5e96aeb365aa8fabd51bb0d85f5f2bfe0135d392bb2f4120aa6b8171415906da" url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.zip" homepage "https://brew.sh/" app "Transmission.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/cask/Casks/outdated/local-caffeine.rb
Library/Homebrew/test/support/fixtures/cask/Casks/outdated/local-caffeine.rb
cask "local-caffeine" do version "1.2.2" sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" app "Caffeine.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/third-party/Casks/pharo.rb
Library/Homebrew/test/support/fixtures/third-party/Casks/pharo.rb
cask "pharo" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" url "https://brew.sh/ThirdParty-#{version}.dmg" name "Pharo" desc "Cask from a third-party tap" homepage "https://brew.sh/" app "ThirdParty.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/fixtures/third-party/Casks/third-party-cask.rb
Library/Homebrew/test/support/fixtures/third-party/Casks/third-party-cask.rb
cask "third-party-cask" do version "1.2.3" sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" url "https://brew.sh/ThirdParty.dmg" homepage "https://brew.sh/" app "ThirdParty.app" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/fixtures.rb
Library/Homebrew/test/support/helper/fixtures.rb
# typed: true # frozen_string_literal: true module Test module Helper module Fixtures def dylib_path(name) MachOPathname.wrap("#{TEST_FIXTURE_DIR}/mach/#{name}.dylib") end def bundle_path(name) MachOPathname.wrap("#{TEST_FIXTURE_DIR}/mach/#{name}.bundle") end def cask_path(name) Pathname.new("#{TEST_FIXTURE_DIR}/cask/Casks/#{name}.rb") end end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/files.rb
Library/Homebrew/test/support/helper/files.rb
# typed: true # frozen_string_literal: true module Test module Helper module Files def self.find_files return [] unless File.exist?(TEST_TMPDIR) Find.find(TEST_TMPDIR) .reject { |f| File.basename(f) == ".DS_Store" } .reject { |f| TEST_DIRECTORIES.include?(Pathname(f)) } .map { |f| f.sub(TEST_TMPDIR, "") } end end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/mktmpdir.rb
Library/Homebrew/test/support/helper/mktmpdir.rb
# frozen_string_literal: true module Test module Helper module MkTmpDir def mktmpdir(prefix_suffix = nil) new_dir = Pathname.new(Dir.mktmpdir(prefix_suffix, HOMEBREW_TEMP)) return yield new_dir if block_given? new_dir end end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/integration_mocks.rb
Library/Homebrew/test/support/helper/integration_mocks.rb
# typed: true # frozen_string_literal: true module Homebrew module Diagnostic class Checks def check_integration_test "This is an integration test" if ENV["HOMEBREW_INTEGRATION_TEST"] end end end def exec(*args) if ENV["HOMEBREW_TESTS_COVERAGE"] && ENV["HOMEBREW_INTEGRATION_TEST"] # Ensure we get coverage results before replacing the current process. SimpleCov.result end Kernel.exec(*args) end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/formula.rb
Library/Homebrew/test/support/helper/formula.rb
# frozen_string_literal: true require "formulary" module Test module Helper module Formula def formula(name = "formula_name", path: nil, spec: :stable, alias_path: nil, tap: nil, &block) path ||= Formulary.find_formula_in_tap(name, tap || CoreTap.instance) Class.new(::Formula, &block).new(name, path, spec, alias_path:, tap:) end # Use a stubbed {Formulary::FormulaLoader} to make a given formula be found # when loading from {Formulary} with `ref`. def stub_formula_loader(formula, ref = formula.full_name, call_original: false) allow(Formulary).to receive(:loader_for).and_call_original if call_original loader = instance_double(Formulary::FormulaLoader, get_formula: formula, name: formula.name) allow(Formulary).to receive(:loader_for).with(ref, any_args).and_return(loader) end end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/cask.rb
Library/Homebrew/test/support/helper/cask.rb
# frozen_string_literal: true require "cask/cask_loader" module Test module Helper module Cask def stub_cask_loader(cask, ref = cask.token, call_original: false) allow(::Cask::CaskLoader).to receive(:for).and_call_original if call_original loader = ::Cask::CaskLoader::FromInstanceLoader.new(cask) allow(::Cask::CaskLoader).to receive(:for).with(ref, any_args).and_return(loader) end end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/cmd/brew-verify-undefined.rb
Library/Homebrew/test/support/helper/cmd/brew-verify-undefined.rb
# typed: strict # frozen_string_literal: true require "cli/parser" require "utils/output" UNDEFINED_CONSTANTS = %w[ AbstractDownloadStrategy Addressable Base64 CacheStore Cask::Cask Cask::CaskLoader Completions CSV Formula Formulary GitRepository Homebrew::API Homebrew::Manpages Homebrew::Settings JSONSchemer Kramdown Metafiles MethodSource Minitest Nokogiri OS::Mac::Version PatchELF Pry ProgressBar REXML Red RSpec RuboCop StackProf Spoom Tap Tapioca UnpackStrategy Utils::Analytics Utils::Backtrace Utils::Bottles Utils::Curl Utils::Fork Utils::Git Utils::GitHub Utils::Link Utils::Svn Uri Vernier YARD ].freeze module Homebrew module Cmd class VerifyUndefined < AbstractCommand sig { override.void } def run; end end end end parser = Homebrew::CLI::Parser.new(Homebrew::Cmd::VerifyUndefined) do usage_banner <<~EOS `verify-undefined` Verifies that the following constants have not been defined at startup to make sure that startup times stay consistent. Constants: #{UNDEFINED_CONSTANTS.join("\n")} EOS end parser.parse UNDEFINED_CONSTANTS.each do |constant_name| Object.const_get(constant_name) Utils::Output.ofail "#{constant_name} should not be defined at startup" rescue NameError # We expect this to error as it should not be defined. end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/cask/install_helper.rb
Library/Homebrew/test/support/helper/cask/install_helper.rb
# typed: true # frozen_string_literal: true require "cask/installer" module InstallHelper module_function def self.install_without_artifacts(cask) Cask::Installer.new(cask).tap do |i| i.download i.extract_primary_container end end def self.install_without_artifacts_with_caskfile(cask) Cask::Installer.new(cask).tap do |i| i.download i.extract_primary_container i.save_caskfile end end def install_without_artifacts(cask) Cask::Installer.new(cask).tap do |i| i.download i.extract_primary_container end end def install_with_caskfile(cask) Cask::Installer.new(cask).tap(&:save_caskfile) end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/cask/never_sudo_system_command.rb
Library/Homebrew/test/support/helper/cask/never_sudo_system_command.rb
# typed: true # frozen_string_literal: true require "system_command" class NeverSudoSystemCommand < SystemCommand def self.run(command, **options) super(command, **options.merge(sudo: false, sudo_as_root: false)) end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
# frozen_string_literal: true require "open3" require "formula_installer" require "uninstall" RSpec::Matchers.define_negated_matcher :be_a_failure, :be_a_success # These shared contexts starting with `when` don't make sense. RSpec.shared_context "integration test" do # rubocop:disable RSpec/ContextWording extend RSpec::Matchers::DSL matcher :be_a_success do match do |actual| status = actual.is_a?(Proc) ? actual.call : actual expect(status).to respond_to(:success?) status.success? end def supports_block_expectations? true end # It needs to be nested like this: # # expect { # expect { # # command # }.to be_a_success # }.to output(something).to_stdout # # rather than this: # # expect { # expect { # # command # }.to output(something).to_stdout # }.to be_a_success # def expects_call_stack_jump? true end end around do |example| ENV["HOMEBREW_INTEGRATION_TEST"] = "1" (HOMEBREW_PREFIX/"bin").mkpath FileUtils.touch HOMEBREW_PREFIX/"bin/brew" example.run ensure FileUtils.rm_rf HOMEBREW_PREFIX/"bin" ENV.delete("HOMEBREW_INTEGRATION_TEST") end # Generate unique ID to be able to # properly merge coverage results. def command_id Thread.current[:brew_integration_test_number] ||= 0 "#{ENV.fetch("TEST_ENV_NUMBER", "")}:#{Thread.current[:brew_integration_test_number] += 1}" end # Runs a `brew` command with the test configuration # and with coverage reporting enabled. def brew(*args) env = args.last.is_a?(Hash) ? args.pop : {} # Avoid warnings when HOMEBREW_PREFIX/bin is not in PATH. # Also include our extra commands directory. path = [ env["PATH"], (HOMEBREW_LIBRARY_PATH/"test/support/helper/cmd").realpath.to_s, (HOMEBREW_PREFIX/"bin").realpath.to_s, ENV.fetch("PATH"), ].compact.join(File::PATH_SEPARATOR) env.merge!( "PATH" => path, "HOMEBREW_PATH" => path, "HOMEBREW_BREW_FILE" => HOMEBREW_PREFIX/"bin/brew", "HOMEBREW_INTEGRATION_TEST" => command_id, "HOMEBREW_TEST_TMPDIR" => TEST_TMPDIR, "HOMEBREW_DEV_CMD_RUN" => "true", "HOMEBREW_USE_RUBY_FROM_PATH" => ENV.fetch("HOMEBREW_USE_RUBY_FROM_PATH", nil), "HOMEBREW_NO_INSTALL_FROM_API" => ENV.fetch("HOMEBREW_NO_INSTALL_FROM_API", nil), "GEM_HOME" => nil, ) @ruby_args ||= begin ruby_args = HOMEBREW_RUBY_EXEC_ARGS.dup if ENV["HOMEBREW_TESTS_COVERAGE"] simplecov_spec = Gem.loaded_specs["simplecov"] parallel_tests_spec = Gem.loaded_specs["parallel_tests"] specs = [] [simplecov_spec, parallel_tests_spec].each do |spec| specs << spec spec.runtime_dependencies.each do |dep| specs += dep.to_specs rescue Gem::LoadError => e onoe e end end specs.flat_map(&:full_require_paths).each { |lib| ruby_args << "-I" << lib } ruby_args << "-rsimplecov" end ruby_args << "-r#{HOMEBREW_LIBRARY_PATH}/test/support/helper/integration_mocks" ruby_args << "-e" << "$0 = ARGV.shift; load($0)" ruby_args << (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path.to_s end Bundler.with_unbundled_env do # Allow instance variable here to improve performance through memoization. # rubocop:disable RSpec/InstanceVariable stdout, stderr, status = Open3.capture3(env, *@ruby_args, *args) # rubocop:enable RSpec/InstanceVariable $stdout.print stdout $stderr.print stderr status end end def brew_sh(*args) env = { "HOMEBREW_USE_RUBY_FROM_PATH" => ENV.fetch("HOMEBREW_USE_RUBY_FROM_PATH", nil), "HOMEBREW_CACHE" => HOMEBREW_CACHE.to_s, } Bundler.with_unbundled_env do stdout, stderr, status = Open3.capture3(env, "#{ENV.fetch("HOMEBREW_PREFIX")}/bin/brew", *args) $stdout.print stdout $stderr.print stderr status end end def setup_test_formula(name, content = nil, tap: CoreTap.instance, bottle_block: nil, tab_attributes: nil) case name when /^testball/ # Use a different tarball for testball2 to avoid lock errors when writing concurrency tests prefix = (name == "testball2") ? "testball2" : "testball" tarball = if OS.linux? TEST_FIXTURE_DIR/"tarballs/#{prefix}-0.1-linux.tbz" else TEST_FIXTURE_DIR/"tarballs/#{prefix}-0.1.tbz" end bottle_block ||= <<~RUBY if name == "testball_bottle" bottle do root_url "file://#{TEST_FIXTURE_DIR}/bottles" sha256 cellar: :any_skip_relocation, all: "d7b9f4e8bf83608b71fe958a99f19f2e5e68bb2582965d32e41759c24f1aef97" end RUBY content = <<~RUBY desc "Some test" homepage "https://brew.sh/#{name}" url "file://#{tarball}" sha256 "#{tarball.sha256}" option "with-foo", "Build with foo" #{bottle_block} def install (prefix/"foo"/"test").write("test") if build.with? "foo" prefix.install Dir["*"] (buildpath/"test.c").write \ "#include <stdio.h>\\nint main(){printf(\\"test\\");return 0;}" bin.mkpath system ENV.cc, "test.c", "-o", bin/"test" end #{content} # something here RUBY when "bar" content = <<~RUBY url "https://brew.sh/#{name}-1.0" depends_on "foo" RUBY when "package_license" content = <<~RUBY url "https://brew.sh/#patchelf-1.0" license "0BSD" RUBY else content ||= <<~RUBY url "https://brew.sh/#{name}-1.0" RUBY end formula_path = Formulary.find_formula_in_tap(name.downcase, tap).tap do |path| path.dirname.mkpath path.write <<~RUBY class #{Formulary.class_s(name)} < Formula #{content.gsub(/^(?!$)/, " ")} end RUBY tap.clear_cache end return formula_path if tab_attributes.nil? keg = Formula[name].prefix keg.mkpath tab = Tab.for_name(name) tab.tabfile ||= keg/AbstractTab::FILENAME tab_attributes.each do |key, value| tab.instance_variable_set(:"@#{key}", value) end tab.write formula_path end def install_test_formula(name, content = nil, build_bottle: false) setup_test_formula(name, content) fi = FormulaInstaller.new(Formula[name], build_bottle:, installed_on_request: true) fi.prelude_fetch fi.prelude fi.fetch fi.install fi.finish end def uninstall_test_formula(name) rack = HOMEBREW_CELLAR/name kegs = rack.children.map { |prefix| Keg.new(prefix) } Homebrew::Uninstall.uninstall_kegs({ rack => kegs }, force: true, ignore_dependencies: true) end def setup_test_tap path = HOMEBREW_TAP_DIRECTORY/"homebrew/homebrew-foo" path.mkpath path.cd do system "git", "init" system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" FileUtils.touch "readme" system "git", "add", "--all" system "git", "commit", "-m", "init" end path end def setup_remote_tap(name) Tap.fetch(name).tap do |tap| next if tap.installed? full_name = Tap.fetch(name).full_name # Check to see if the original Homebrew process has taps we can use. system_tap_path = Pathname("#{ENV.fetch("HOMEBREW_LIBRARY")}/Taps/#{full_name}") if system_tap_path.exist? system "git", "clone", "--shared", system_tap_path, tap.path system "git", "-C", tap.path, "checkout", "master" else tap.install(quiet: true) end end end def install_and_rename_coretap_formula(old_name, new_name) CoreTap.instance.path.cd do |tap_path| system "git", "init" system "git", "add", "--all" system "git", "commit", "-m", "#{old_name.capitalize} has not yet been renamed" brew "install", old_name (tap_path/"Formula/#{old_name}.rb").unlink (tap_path/"formula_renames.json").write JSON.pretty_generate(old_name => new_name) system "git", "add", "--all" system "git", "commit", "-m", "#{old_name.capitalize} has been renamed to #{new_name.capitalize}" end end def testball "#{TEST_FIXTURE_DIR}/testball.rb" end end RSpec.configure do |config| config.include_context "integration test", :integration_test end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb
Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb
# frozen_string_literal: true require "cask/config" require "cask/cache" require "test/support/helper/cask/install_helper" require "test/support/helper/cask/never_sudo_system_command" module Cask class Config DEFAULT_DIRS_PATHNAMES = { appdir: Pathname(TEST_TMPDIR)/"cask-appdir", keyboard_layoutdir: Pathname(TEST_TMPDIR)/"cask-keyboard-layoutdir", prefpanedir: Pathname(TEST_TMPDIR)/"cask-prefpanedir", qlplugindir: Pathname(TEST_TMPDIR)/"cask-qlplugindir", mdimporterdir: Pathname(TEST_TMPDIR)/"cask-mdimporter", dictionarydir: Pathname(TEST_TMPDIR)/"cask-dictionarydir", fontdir: Pathname(TEST_TMPDIR)/"cask-fontdir", colorpickerdir: Pathname(TEST_TMPDIR)/"cask-colorpickerdir", servicedir: Pathname(TEST_TMPDIR)/"cask-servicedir", input_methoddir: Pathname(TEST_TMPDIR)/"cask-input_methoddir", internet_plugindir: Pathname(TEST_TMPDIR)/"cask-internet_plugindir", audio_unit_plugindir: Pathname(TEST_TMPDIR)/"cask-audio_unit_plugindir", vst_plugindir: Pathname(TEST_TMPDIR)/"cask-vst_plugindir", vst3_plugindir: Pathname(TEST_TMPDIR)/"cask-vst3_plugindir", screen_saverdir: Pathname(TEST_TMPDIR)/"cask-screen_saverdir", }.freeze remove_const :DEFAULT_DIRS DEFAULT_DIRS = DEFAULT_DIRS_PATHNAMES.transform_values(&:to_s).freeze end end # These shared contexts starting with `when` don't make sense. RSpec.shared_context "Homebrew Cask", :needs_macos do # rubocop:disable RSpec/ContextWording around do |example| third_party_tap = Tap.fetch("third-party", "tap") begin Cask::Config::DEFAULT_DIRS_PATHNAMES.each_value(&:mkpath) CoreCaskTap.instance.tap do |tap| fixture_cask_dir = TEST_FIXTURE_DIR/"cask/Casks" fixture_cask_dir.glob("**/*.rb").each do |fixture_cask_path| relative_cask_path = fixture_cask_path.relative_path_from(fixture_cask_dir) # These are only used manually in tests since they # would otherwise conflict with other casks. next if relative_cask_path.dirname.basename.to_s == "outdated" cask_dir = (tap.cask_dir/relative_cask_path.dirname).tap(&:mkpath) FileUtils.ln_sf fixture_cask_path, cask_dir end tap.clear_cache end third_party_tap.tap do |tap| tap.path.parent.mkpath FileUtils.ln_sf TEST_FIXTURE_DIR/"third-party", tap.path tap.clear_cache end example.run ensure FileUtils.rm_rf Cask::Config::DEFAULT_DIRS_PATHNAMES.values FileUtils.rm_rf [Cask::Config.new.binarydir, Cask::Caskroom.path, Cask::Cache.path] FileUtils.rm_rf CoreCaskTap.instance.path FileUtils.rm_rf third_party_tap.path FileUtils.rm_rf third_party_tap.path.parent end end end RSpec.configure do |config| config.include_context "Homebrew Cask", :cask end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb
Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb
# frozen_string_literal: true RSpec.shared_examples "formulae exist" do |array| array.each do |f| it "#{f} formula exists", :needs_homebrew_core do core_tap = Pathname("#{HOMEBREW_LIBRARY_PATH}/../Taps/homebrew/homebrew-core") formula_paths = core_tap.glob("Formula/**/#{f}.rb") alias_path = core_tap/"Aliases/#{f}" expect(formula_paths.any?(&:exist?) || alias_path.exist?).to be true end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/lib/startup/config.rb
Library/Homebrew/test/support/lib/startup/config.rb
# typed: true # frozen_string_literal: true raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!" unless ENV["HOMEBREW_BREW_FILE"] HOMEBREW_ORIGINAL_BREW_FILE = Pathname.new(ENV.fetch("HOMEBREW_ORIGINAL_BREW_FILE")).freeze HOMEBREW_BREW_FILE = Pathname.new(ENV.fetch("HOMEBREW_BREW_FILE")).freeze TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") do |k| dir = Dir.mktmpdir("homebrew-tests-", ENV.fetch("HOMEBREW_TEMP")) at_exit do # Child processes inherit this at_exit handler, but we don't want them # to clean TEST_TMPDIR up prematurely (i.e. when they exit early for a test). FileUtils.remove_entry(dir) unless ENV["HOMEBREW_TEST_NO_EXIT_CLEANUP"] end ENV[k] = dir end.freeze # Paths pointing into the Homebrew code base that persist across test runs HOMEBREW_SHIMS_PATH = (HOMEBREW_LIBRARY_PATH/"shims").freeze # Where external data that has been incorporated into Homebrew is stored HOMEBREW_DATA_PATH = (HOMEBREW_LIBRARY_PATH/"data").freeze # Paths redirected to a temporary directory and wiped at the end of the test run HOMEBREW_PREFIX = (Pathname(TEST_TMPDIR)/"prefix").freeze HOMEBREW_ALIASES = (Pathname(TEST_TMPDIR)/"aliases").freeze HOMEBREW_REPOSITORY = HOMEBREW_PREFIX.dup.freeze HOMEBREW_LIBRARY = (HOMEBREW_REPOSITORY/"Library").freeze HOMEBREW_CACHE = (HOMEBREW_PREFIX.parent/"cache").freeze HOMEBREW_CACHE_FORMULA = (HOMEBREW_PREFIX.parent/"formula_cache").freeze HOMEBREW_LINKED_KEGS = (HOMEBREW_PREFIX/"var/homebrew/linked").freeze HOMEBREW_PINNED_KEGS = (HOMEBREW_PREFIX/"var/homebrew/pinned").freeze HOMEBREW_LOCKS = (HOMEBREW_PREFIX/"var/homebrew/locks").freeze HOMEBREW_TEMP_CELLAR = (HOMEBREW_PREFIX/"var/homebrew/tmp/.cellar").freeze HOMEBREW_CELLAR = (HOMEBREW_PREFIX/"Cellar").freeze HOMEBREW_LOGS = (HOMEBREW_PREFIX.parent/"logs").freeze HOMEBREW_TEMP = (HOMEBREW_PREFIX.parent/"temp").freeze HOMEBREW_TAP_DIRECTORY = (HOMEBREW_LIBRARY/"Taps").freeze HOMEBREW_RUBY_EXEC_ARGS = [ RUBY_PATH, ENV.fetch("HOMEBREW_RUBY_WARNINGS"), ENV.fetch("HOMEBREW_RUBY_DISABLE_OPTIONS"), "-I", HOMEBREW_LIBRARY_PATH/"test/support/lib" ].freeze TEST_FIXTURE_DIR = (HOMEBREW_LIBRARY_PATH/"test/support/fixtures").freeze TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b" TESTBALL_PATCHES_SHA256 = "799c2d551ac5c3a5759bea7796631a7906a6a24435b52261a317133a0bfb34d9" PATCH_A_SHA256 = "83404f4936d3257e65f176c4ffb5a5b8d6edd644a21c8d8dcc73e22a6d28fcfa" PATCH_B_SHA256 = "57958271bb802a59452d0816e0670d16c8b70bdf6530bcf6f78726489ad89b90" PATCH_D_SHA256 = "07c72c4463339e6e2ce235f3b26e316d4940017bf4b5236e27e757a44d67636c" TEST_SHA256 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/support/extend/cachable.rb
Library/Homebrew/test/support/extend/cachable.rb
# frozen_string_literal: true raise "This needs to be required before Cachable gets loaded normally." if defined?(Cachable) # Collect all classes that mix in Cachable so that those caches can be cleared in-between tests. module Cachable private_class_method def self.included(klass) # It's difficult to backtrack from a singleton class to find the original class # and you can always just extend this module instead for equivalent behavior. raise ArgumentError, "Don't use Cachable with singleton classes" if klass.singleton_class? super if defined?(super) end private_class_method def self.extended(klass) Registry.class_list << klass # Ignore the `Formula` class that gets inherited from a lot and # that has caches that we don't need to clear on the class level. klass.extend(Inherited) if klass.name != "Formula" super if defined?(super) end module Inherited private def inherited(klass) # A class might inherit Cachable at the instance level # and in that case we just want to skip registering it. Registry.class_list << klass if klass.respond_to?(:clear_cache) super if defined?(super) end end module Registry # A list of all classes that have been loaded into memory that mixin or # inherit `Cachable` at the class or module level. # # NOTE: Classes that inherit from `Formula` are excluded since it's not # necessary to track and clear individual formula caches. def self.class_list @class_list ||= [] end # Clear the cache of every class or module that mixes in or inherits # `Cachable` at the class or module level. # # NOTE: Classes that inherit from `Formula` are excluded since it's not # necessary to track and clear individual formula caches. def self.clear_all_caches class_list.each(&:clear_cache) end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/search_spec.rb
Library/Homebrew/test/cmd/search_spec.rb
# frozen_string_literal: true require "cmd/search" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::SearchCmd do it_behaves_like "parseable arguments" it "finds formula in search", :integration_test, :no_api do setup_test_formula "testball" expect { brew "search", "testball" } .to output(/testball/).to_stdout .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/--cache_spec.rb
Library/Homebrew/test/cmd/--cache_spec.rb
# frozen_string_literal: true require "cmd/--cache" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Cache do it_behaves_like "parseable arguments" it "prints all cache files for a given Formula", :integration_test do expect { brew "--cache", testball } .to output(%r{#{HOMEBREW_CACHE}/downloads/[\da-f]{64}--testball-}o).to_stdout .and be_a_success expect { brew "--cache", "--formula", testball } .to output(%r{#{HOMEBREW_CACHE}/downloads/[\da-f]{64}--testball-}o).to_stdout .and not_to_output.to_stderr .and be_a_success end it "prints the cache files for a given Cask", :integration_test, :needs_macos do expect { brew "--cache", cask_path("local-caffeine") } .to output(%r{#{HOMEBREW_CACHE}/downloads/[\da-f]{64}--caffeine\.zip}o).to_stdout .and output(/Treating #{Regexp.escape(cask_path("local-caffeine"))} as a cask/).to_stderr .and be_a_success expect { brew "--cache", "--cask", cask_path("local-caffeine") } .to output(%r{#{HOMEBREW_CACHE}/downloads/[\da-f]{64}--caffeine\.zip}o).to_stdout .and not_to_output.to_stderr .and be_a_success end it "prints the cache files for a given Formula and Cask", :integration_test, :needs_macos do expect { brew "--cache", testball, cask_path("local-caffeine") } .to output( %r{ #{HOMEBREW_CACHE}/downloads/[\da-f]{64}--testball-.*\n #{HOMEBREW_CACHE}/downloads/[\da-f]{64}--caffeine\.zip }xo, ).to_stdout .and output(/(Treating .* as a formula).*(Treating .* as a cask)/m).to_stderr .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/desc_spec.rb
Library/Homebrew/test/cmd/desc_spec.rb
# frozen_string_literal: true require "cmd/desc" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Desc do it_behaves_like "parseable arguments" it "shows a given Formula's description", :integration_test do setup_test_formula "testball" expect { brew "desc", "testball" } .to output("testball: Some test\n").to_stdout .and not_to_output.to_stderr .and be_a_success end it "errors when searching without --eval-all", :integration_test, :no_api do setup_test_formula "testball" expect { brew "desc", "--search", "testball" } .to output(/`brew desc --search` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL=1` set!/).to_stderr .and be_a_failure end it "successfully searches with --search --eval-all", :integration_test, :no_api do setup_test_formula "testball" expect { brew "desc", "--search", "--eval-all", "ball" } .to output(/testball: Some test/).to_stdout .and not_to_output.to_stderr end it "successfully searches without --eval-all, with API", :integration_test, :needs_network do setup_test_formula "testball" expect { brew "desc", "--search", "testball" }.to be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/pin_spec.rb
Library/Homebrew/test/cmd/pin_spec.rb
# frozen_string_literal: true require "cmd/pin" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Pin do it_behaves_like "parseable arguments" it "pins a Formula's version", :integration_test do setup_test_formula "testball", tab_attributes: { installed_on_request: true } expect { brew "pin", "testball" }.to be_a_success end it "fails with an uninstalled Formula", :integration_test do setup_test_formula "testball" expect { brew "pin", "testball" }.to be_a_failure end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/unpin_spec.rb
Library/Homebrew/test/cmd/unpin_spec.rb
# frozen_string_literal: true require "cmd/shared_examples/args_parse" require "cmd/unpin" RSpec.describe Homebrew::Cmd::Unpin do it_behaves_like "parseable arguments" it "unpins a Formula's version", :integration_test do setup_test_formula "testball", tab_attributes: { installed_on_request: true } Formula["testball"].pin expect { brew "unpin", "testball" }.to be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/doctor_spec.rb
Library/Homebrew/test/cmd/doctor_spec.rb
# frozen_string_literal: true require "cmd/doctor" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Doctor do it_behaves_like "parseable arguments" specify "check_integration_test", :integration_test do expect { brew "doctor", "check_integration_test" } .to output(/This is an integration test/).to_stderr end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/completions_spec.rb
Library/Homebrew/test/cmd/completions_spec.rb
# frozen_string_literal: true require "cmd/completions" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::CompletionsCmd do it_behaves_like "parseable arguments" it "runs the status subcommand correctly", :integration_test do HOMEBREW_REPOSITORY.cd do system "git", "init" end brew "completions", "link" expect { brew "completions" } .to output(/Completions are linked/).to_stdout .and not_to_output.to_stderr .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/install_spec.rb
Library/Homebrew/test/cmd/install_spec.rb
# frozen_string_literal: true require "cmd/install" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::InstallCmd do include FileUtils it_behaves_like "parseable arguments" context "when using a bottle" do let(:formula_name) { "testball_bottle" } let(:formula_prefix) { HOMEBREW_CELLAR/formula_name/"0.1" } let(:formula_prefix_regex) { /#{Regexp.escape(formula_prefix)}/o } let(:option_file) { formula_prefix/"foo/test" } let(:bottle_file) { formula_prefix/"bin/helloworld" } it "installs a Formula", :integration_test do setup_test_formula formula_name expect { brew "install", formula_name } .to output(formula_prefix_regex).to_stdout .and output(/βœ”οΈŽ.*/m).to_stderr .and be_a_success expect(option_file).not_to be_a_file expect(bottle_file).to be_a_file uninstall_test_formula formula_name expect { brew "install", "--ask", formula_name } .to output(/.*Formula\s*\(1\):\s*#{formula_name}.*/).to_stdout .and output(/βœ”οΈŽ.*/m).to_stderr .and be_a_success expect(option_file).not_to be_a_file expect(bottle_file).to be_a_file uninstall_test_formula formula_name expect { brew "install", formula_name, { "HOMEBREW_FORBIDDEN_FORMULAE" => formula_name } } .to not_to_output(formula_prefix_regex).to_stdout .and output(/#{formula_name} was forbidden/).to_stderr .and be_a_failure expect(formula_prefix).not_to exist end it "installs a keg-only Formula", :integration_test do setup_test_formula formula_name, <<~RUBY keg_only "test reason" RUBY expect { brew "install", formula_name } .to output(formula_prefix_regex).to_stdout .and output(/βœ”οΈŽ.*/m).to_stderr .and be_a_success expect(option_file).not_to be_a_file expect(bottle_file).to be_a_file expect(HOMEBREW_PREFIX/"bin/helloworld").not_to be_a_file end end context "when building from source" do let(:formula_name) { "testball1" } it "installs a Formula", :integration_test do formula_prefix = HOMEBREW_CELLAR/formula_name/"0.1" formula_prefix_regex = /#{Regexp.escape(formula_prefix)}/o option_file = formula_prefix/"foo/test" always_built_file = formula_prefix/"bin/test" setup_test_formula formula_name expect { brew "install", formula_name, "--with-foo" } .to output(formula_prefix_regex).to_stdout .and output(/βœ”οΈŽ.*/m).to_stderr .and be_a_success expect(option_file).to be_a_file expect(always_built_file).to be_a_file uninstall_test_formula formula_name expect { brew "install", formula_name, "--debug-symbols", "--build-from-source" } .to output(formula_prefix_regex).to_stdout .and output(/βœ”οΈŽ.*/m).to_stderr .and be_a_success expect(option_file).not_to be_a_file expect(always_built_file).to be_a_file expect(formula_prefix/"bin/test.dSYM/Contents/Resources/DWARF/test").to be_a_file if OS.mac? expect(HOMEBREW_CACHE/"Sources/#{formula_name}").to be_a_directory end it "installs a HEAD Formula", :integration_test do testball1_prefix = HOMEBREW_CELLAR/"testball1/HEAD-d5eb689" repo_path = HOMEBREW_CACHE/"repo" (repo_path/"bin").mkpath repo_path.cd do system "git", "-c", "init.defaultBranch=master", "init" system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" FileUtils.touch "bin/something.bin" FileUtils.touch "README" system "git", "add", "--all" system "git", "commit", "-m", "Initial repo commit" end setup_test_formula "testball1", <<~RUBY version "1.0" head "file://#{repo_path}", using: :git def install prefix.install Dir["*"] end RUBY expect { brew "install", formula_name, "--HEAD", "HOMEBREW_DOWNLOAD_CONCURRENCY" => "1" } .to output(/#{Regexp.escape(testball1_prefix)}/o).to_stdout .and output(/Cloning into/).to_stderr .and be_a_success expect(testball1_prefix/"foo/test").not_to be_a_file expect(testball1_prefix/"bin/something.bin").to be_a_file end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/bundle_spec.rb
Library/Homebrew/test/cmd/bundle_spec.rb
# frozen_string_literal: true require "cmd/bundle" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Bundle do it_behaves_like "parseable arguments" it "checks if a Brewfile's dependencies are satisfied", :integration_test do HOMEBREW_REPOSITORY.cd do system "git", "init" system "git", "commit", "--allow-empty", "-m", "This is a test commit" end mktmpdir do |path| FileUtils.touch "#{path}/Brewfile" path.cd do expect { brew "bundle", "check" } .to output("The Brewfile's dependencies are satisfied.\n").to_stdout .and not_to_output.to_stderr .and be_a_success end end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/mcp-server_spec.rb
Library/Homebrew/test/cmd/mcp-server_spec.rb
# frozen_string_literal: true RSpec.describe "brew mcp-server", type: :system do it "starts the MCP server", :integration_test do # This is the easiest way to handle a newline here. # rubocop:disable Style/StringConcatenation expect { brew_sh "mcp-server", "--ping" } .to output("==> Started Homebrew MCP server...\n").to_stderr .and output('{"jsonrpc":"2.0","id":1,"result":{}}' + "\n").to_stdout .and be_a_success # rubocop:enable Style/StringConcatenation end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/--version_spec.rb
Library/Homebrew/test/cmd/--version_spec.rb
# frozen_string_literal: true RSpec.describe "brew --version", type: :system do it "prints the Homebrew's version", :integration_test do expect { brew_sh "--version" } .to output(/^Homebrew #{Regexp.escape(HOMEBREW_VERSION)}\n/o).to_stdout .and not_to_output.to_stderr .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/pyenv-sync_spec.rb
Library/Homebrew/test/cmd/pyenv-sync_spec.rb
# frozen_string_literal: true require "cmd/pyenv-sync" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::PyenvSync do it_behaves_like "parseable arguments" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/--repository_spec.rb
Library/Homebrew/test/cmd/--repository_spec.rb
# frozen_string_literal: true RSpec.describe "brew --repository", type: :system do it "prints Homebrew's repository", :integration_test do expect { brew_sh "--repository" } .to output("#{ENV.fetch("HOMEBREW_REPOSITORY")}\n").to_stdout .and not_to_output.to_stderr .and be_a_success end it "prints a Tap's repository", :integration_test do expect { brew_sh "--repository", "foo/bar" } .to output("#{ENV.fetch("HOMEBREW_LIBRARY")}/Taps/foo/homebrew-bar\n").to_stdout .and not_to_output.to_stderr .and be_a_success end it "prints a Tap's repository correctly when homebrew- prefix is supplied", :integration_test do expect { brew_sh "--repository", "foo/homebrew-bar" } .to output("#{ENV.fetch("HOMEBREW_LIBRARY")}/Taps/foo/homebrew-bar\n").to_stdout .and not_to_output.to_stderr .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/source_spec.rb
Library/Homebrew/test/cmd/source_spec.rb
# frozen_string_literal: true require "cmd/source" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Source do it_behaves_like "parseable arguments" it "opens the Homebrew repo when no formula is specified", :integration_test do expect { brew "source", "HOMEBREW_BROWSER" => "echo" } .to output(%r{https://github\.com/Homebrew/brew}).to_stdout .and not_to_output.to_stderr .and be_a_success end describe "#github_repo_url" do it "extracts repository URL from GitHub URL" do expect(described_class.new([]).send(:github_repo_url, "https://github.com/Homebrew/brew.git")) .to eq("https://github.com/Homebrew/brew") end it "handles GitHub archive URLs" do expect(described_class.new([]).send(:github_repo_url, "https://github.com/Homebrew/testball/archive/refs/tags/v0.1.tar.gz")) .to eq("https://github.com/Homebrew/testball") end it "returns nil for non-GitHub URLs" do expect(described_class.new([]).send(:github_repo_url, "https://example.com/repo.git")) .to be_nil end end describe "#gitlab_repo_url" do it "extracts repository URL from GitLab URL with nested groups" do expect(described_class.new([]).send(:gitlab_repo_url, "https://gitlab.com/group/subgroup/project/-/archive/v1.0/project-v1.0.tar.gz")) .to eq("https://gitlab.com/group/subgroup/project") end it "handles GitLab .git URLs" do expect(described_class.new([]).send(:gitlab_repo_url, "https://gitlab.com/user/repo.git")) .to eq("https://gitlab.com/user/repo") end it "returns nil for non-GitLab URLs" do expect(described_class.new([]).send(:gitlab_repo_url, "https://example.com/repo.git")) .to be_nil end end describe "#bitbucket_repo_url" do it "extracts repository URL from Bitbucket URL" do expect(described_class.new([]).send(:bitbucket_repo_url, "https://bitbucket.org/user/repo/get/v1.0.tar.gz")) .to eq("https://bitbucket.org/user/repo") end it "handles Bitbucket .git URLs" do expect(described_class.new([]).send(:bitbucket_repo_url, "https://bitbucket.org/user/repo.git")) .to eq("https://bitbucket.org/user/repo") end it "returns nil for non-Bitbucket URLs" do expect(described_class.new([]).send(:bitbucket_repo_url, "https://example.com/repo.git")) .to be_nil end end describe "#codeberg_repo_url" do it "extracts repository URL from Codeberg URL" do expect(described_class.new([]).send(:codeberg_repo_url, "https://codeberg.org/user/repo/archive/v1.0.tar.gz")) .to eq("https://codeberg.org/user/repo") end it "handles Codeberg .git URLs" do expect(described_class.new([]).send(:codeberg_repo_url, "https://codeberg.org/user/repo.git")) .to eq("https://codeberg.org/user/repo") end it "returns nil for non-Codeberg URLs" do expect(described_class.new([]).send(:codeberg_repo_url, "https://example.com/repo.git")) .to be_nil end end describe "#sourcehut_repo_url" do it "extracts repository URL from SourceHut URL" do expect(described_class.new([]).send(:sourcehut_repo_url, "https://git.sr.ht/~user/repo/archive/v1.0.tar.gz")) .to eq("https://sr.ht/~user/repo") end it "handles sr.ht URLs without git subdomain" do expect(described_class.new([]).send(:sourcehut_repo_url, "https://sr.ht/~user/repo")) .to eq("https://sr.ht/~user/repo") end it "returns nil for non-SourceHut URLs" do expect(described_class.new([]).send(:sourcehut_repo_url, "https://example.com/repo.git")) .to be_nil end end describe "#url_to_repo" do it "returns GitHub repo URL for GitHub URLs" do expect(described_class.new([]).send(:url_to_repo, "https://github.com/Homebrew/brew")) .to eq("https://github.com/Homebrew/brew") end it "returns GitLab repo URL for GitLab URLs" do expect(described_class.new([]).send(:url_to_repo, "https://gitlab.com/user/repo.git")) .to eq("https://gitlab.com/user/repo") end it "returns nil for unsupported URLs" do expect(described_class.new([]).send(:url_to_repo, "https://example.com/repo.tar.gz")) .to be_nil end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/--caskroom_spec.rb
Library/Homebrew/test/cmd/--caskroom_spec.rb
# frozen_string_literal: true require "cmd/--caskroom" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Caskroom do it_behaves_like "parseable arguments" it "prints Homebrew's Caskroom", :integration_test do expect { brew_sh "--caskroom" } .to output("#{ENV.fetch("HOMEBREW_PREFIX")}/Caskroom\n").to_stdout .and not_to_output.to_stderr .and be_a_success end it "prints the Caskroom for Casks", :integration_test do expect { brew "--caskroom", cask_path("local-transmission"), cask_path("local-caffeine") } .to output("#{HOMEBREW_PREFIX/"Caskroom"/"local-transmission"}\n" \ "#{HOMEBREW_PREFIX/"Caskroom"/"local-caffeine\n"}").to_stdout .and not_to_output.to_stderr .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/gist-logs_spec.rb
Library/Homebrew/test/cmd/gist-logs_spec.rb
# frozen_string_literal: true require "cmd/gist-logs" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::GistLogs do it_behaves_like "parseable arguments" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/--prefix_spec.rb
Library/Homebrew/test/cmd/--prefix_spec.rb
# frozen_string_literal: true require "cmd/--prefix" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Prefix do it_behaves_like "parseable arguments" it "prints Homebrew's prefix", :integration_test do expect { brew_sh "--prefix" } .to output("#{ENV.fetch("HOMEBREW_PREFIX")}\n").to_stdout .and not_to_output.to_stderr .and be_a_success end it "prints the prefix for a Formula", :integration_test, :needs_homebrew_core do expect { brew_sh "--prefix", "wget" } .to output("#{ENV.fetch("HOMEBREW_PREFIX")}/opt/wget\n").to_stdout .and not_to_output.to_stderr .and be_a_success end it "errors if the given Formula doesn't exist", :integration_test do expect { brew "--prefix", "nonexistent" } .to output(/No available formula/).to_stderr .and not_to_output.to_stdout .and be_a_failure end it "prints a warning when `--installed` is used and the given Formula is not installed", :integration_test do expect { brew "--prefix", "--installed", testball } .to not_to_output.to_stdout .and output(/testball/).to_stderr .and be_a_failure end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/migrate_spec.rb
Library/Homebrew/test/cmd/migrate_spec.rb
# frozen_string_literal: true require "cmd/migrate" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Migrate do it_behaves_like "parseable arguments" it "migrates a renamed Formula", :integration_test, :no_api do setup_test_formula "testball1" setup_test_formula "testball2" install_and_rename_coretap_formula "testball1", "testball2" expect { brew "migrate", "testball1" } .to output(/Migrating formula testball1 to testball2/).to_stdout .and not_to_output.to_stderr .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/rbenv-sync_spec.rb
Library/Homebrew/test/cmd/rbenv-sync_spec.rb
# frozen_string_literal: true require "cmd/rbenv-sync" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::RbenvSync do it_behaves_like "parseable arguments" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/tab_spec.rb
Library/Homebrew/test/cmd/tab_spec.rb
# frozen_string_literal: true require "cmd/tab" require "cmd/shared_examples/args_parse" require "tab" RSpec.describe Homebrew::Cmd::TabCmd do def installed_on_request?(formula) # `brew` subprocesses can change the tab, invalidating the cached values. Tab.clear_cache Tab.for_formula(formula).installed_on_request end it_behaves_like "parseable arguments" it "marks or unmarks a formula as installed on request", :integration_test do setup_test_formula "foo", tab_attributes: { "installed_on_request" => false } foo = Formula["foo"] expect { brew "tab", "--installed-on-request", "foo" } .to be_a_success .and output(/foo is now marked as installed on request/).to_stdout .and not_to_output.to_stderr expect(installed_on_request?(foo)).to be true expect { brew "tab", "--no-installed-on-request", "foo" } .to be_a_success .and output(/foo is now marked as not installed on request/).to_stdout .and not_to_output.to_stderr expect(installed_on_request?(foo)).to be false end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/analytics_spec.rb
Library/Homebrew/test/cmd/analytics_spec.rb
# frozen_string_literal: true require "cmd/analytics" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Analytics do it_behaves_like "parseable arguments" it "when HOMEBREW_NO_ANALYTICS is unset is disabled after running `brew analytics off`", :integration_test do HOMEBREW_REPOSITORY.cd do system "git", "init" end brew "analytics", "off" expect { brew "analytics", "HOMEBREW_NO_ANALYTICS" => nil } .to output(/analytics are disabled/i).to_stdout .and not_to_output.to_stderr .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/autoremove_spec.rb
Library/Homebrew/test/cmd/autoremove_spec.rb
# frozen_string_literal: true require "cmd/autoremove" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Autoremove do it_behaves_like "parseable arguments" describe "integration test" do let(:requested_formula) { Formula["testball1"] } let(:unused_formula) { Formula["testball2"] } before do # Make testball1 poured from a bottle tab_attributes = { poured_from_bottle: true, installed_on_request: true, installed_as_dependency: false } setup_test_formula("testball1", tab_attributes:) # Make testball2 poured from a bottle and an unused dependency tab_attributes = { poured_from_bottle: true, installed_on_request: false, installed_as_dependency: true } setup_test_formula("testball2", tab_attributes:) end it "only removes unused dependencies", :integration_test do expect(requested_formula.any_version_installed?).to be true expect(unused_formula.any_version_installed?).to be true # When there are unused dependencies expect { brew "autoremove" } .to be_a_success .and output(/Autoremoving/).to_stdout .and not_to_output.to_stderr expect(requested_formula.any_version_installed?).to be true expect(unused_formula.any_version_installed?).to be false end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/leaves_spec.rb
Library/Homebrew/test/cmd/leaves_spec.rb
# frozen_string_literal: true require "cmd/leaves" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Leaves do it_behaves_like "parseable arguments" context "when there are no installed Formulae", :integration_test do it "prints nothing" do setup_test_formula "foo" setup_test_formula "bar" expect { brew "leaves" } .to not_to_output.to_stdout .and not_to_output.to_stderr .and be_a_success end end context "when there are only installed Formulae without dependencies", :integration_test do it "prints all installed Formulae" do setup_test_formula "foo", tab_attributes: { installed_on_request: true } setup_test_formula "bar" expect { brew "leaves" } .to output("foo\n").to_stdout .and not_to_output.to_stderr .and be_a_success end end context "when there are installed Formulae", :integration_test, :no_api do it "prints all installed Formulae that are not dependencies of another installed Formula" do setup_test_formula "foo" setup_test_formula "bar" (HOMEBREW_CELLAR/"foo/0.1/somedir").mkpath (HOMEBREW_CELLAR/"bar/0.1/somedir").mkpath expect { brew "leaves" } .to output("bar\n").to_stdout .and not_to_output.to_stderr .and be_a_success end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/nodenv-sync_spec.rb
Library/Homebrew/test/cmd/nodenv-sync_spec.rb
# frozen_string_literal: true require "cmd/nodenv-sync" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::NodenvSync do it_behaves_like "parseable arguments" end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/deps_spec.rb
Library/Homebrew/test/cmd/deps_spec.rb
# frozen_string_literal: true require "cmd/deps" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Deps, :integration_test, :no_api do include FileUtils before do setup_test_formula "bar" setup_test_formula "foo" setup_test_formula "test" setup_test_formula "build" setup_test_formula "optional" setup_test_formula "recommended_test" setup_test_formula "baz", <<~RUBY url "https://brew.sh/baz-1.0" depends_on "bar" depends_on "build" => :build depends_on "test" => :test depends_on "optional" => :optional depends_on "recommended_test" => [:recommended, :test] depends_on "installed" RUBY # Mock `Formula#any_version_installed?` by creating the tab in a plausible keg directory and opt link keg_dir = HOMEBREW_CELLAR/"installed/1.0" keg_dir.mkpath touch keg_dir/AbstractTab::FILENAME opt_link = HOMEBREW_PREFIX/"opt/installed" opt_link.parent.mkpath FileUtils.ln_sf keg_dir, opt_link end it_behaves_like "parseable arguments" it "outputs all of a Formula's dependencies and their dependencies on separate lines" do setup_test_formula "installed" expect { brew "deps", "baz", "--include-test", "--missing", "--skip-recommended" } .to be_a_success .and output("bar\nfoo\ntest\n").to_stdout .and output(/not the actual runtime dependencies/).to_stderr end context "with --tree" do it "outputs all requested recursive dependencies" do setup_test_formula "installed", <<~RUBY url "https://brew.sh/installed-1.0" depends_on "bar" RUBY stdout = <<~EOS baz β”œβ”€β”€ bar β”‚ └── foo β”œβ”€β”€ build β”œβ”€β”€ recommended_test └── installed └── bar └── foo EOS expect { brew "deps", "baz", "--tree", "--include-build" } .to be_a_success .and output(stdout).to_stdout end it "--prune skips already seen recursive dependencies" do setup_test_formula "installed", <<~RUBY url "https://brew.sh/installed-1.0" depends_on "bar" RUBY stdout = <<~EOS baz β”œβ”€β”€ bar β”‚ └── foo β”œβ”€β”€ recommended_test └── installed └── bar (PRUNED) EOS expect { brew "deps", "baz", "--tree", "--prune" } .to be_a_success .and output(stdout).to_stdout end it "detects circular dependencies" do setup_test_formula "installed", <<~RUBY url "https://brew.sh/installed-1.0" depends_on "baz" RUBY stdout = <<~EOS baz β”œβ”€β”€ bar β”‚ └── foo β”œβ”€β”€ recommended_test └── installed └── baz (CIRCULAR DEPENDENCY) EOS expect { brew "deps", "baz", "--tree" } .to be_a_failure .and output(stdout).to_stdout end end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/--cellar_spec.rb
Library/Homebrew/test/cmd/--cellar_spec.rb
# frozen_string_literal: true require "cmd/--cellar" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Cellar do it_behaves_like "parseable arguments" it "prints Homebrew's Cellar", :integration_test do expect { brew_sh "--cellar" } .to output("#{ENV.fetch("HOMEBREW_CELLAR")}\n").to_stdout .and not_to_output.to_stderr .and be_a_success end it "prints the Cellar for a Formula", :integration_test do expect { brew "--cellar", testball } .to output(%r{#{HOMEBREW_CELLAR}/testball}o).to_stdout .and not_to_output.to_stderr .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/formulae_spec.rb
Library/Homebrew/test/cmd/formulae_spec.rb
# frozen_string_literal: true RSpec.describe "brew formulae", type: :system do it "prints all installed Formulae", :integration_test do expect { brew_sh "formulae" } .to be_a_success .and not_to_output.to_stderr end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/uses_spec.rb
Library/Homebrew/test/cmd/uses_spec.rb
# frozen_string_literal: true require "cli/named_args" require "cmd/shared_examples/args_parse" require "cmd/uses" require "fileutils" RSpec.describe Homebrew::Cmd::Uses do include FileUtils it_behaves_like "parseable arguments" it "prints the Formulae a given Formula is used by", :integration_test, :no_api do # Included in output setup_test_formula "bar" setup_test_formula "optional", <<~RUBY url "https://brew.sh/optional-1.0" depends_on "bar" => :optional RUBY # Excluded from output setup_test_formula "foo" setup_test_formula "test", <<~RUBY url "https://brew.sh/test-1.0" depends_on "foo" => :test RUBY setup_test_formula "build", <<~RUBY url "https://brew.sh/build-1.0" depends_on "foo" => :build RUBY setup_test_formula "installed", <<~RUBY url "https://brew.sh/installed-1.0" depends_on "foo" RUBY # Mock `Formula#any_version_installed?` by creating the tab in a plausible keg directory %w[foo installed].each do |formula_name| keg_dir = HOMEBREW_CELLAR/formula_name/"1.0" keg_dir.mkpath touch keg_dir/AbstractTab::FILENAME end expect { brew "uses", "foo", "--eval-all", "--include-optional", "--missing", "--recursive" } .to output(/^(bar\noptional|optional\nbar)$/).to_stdout .and not_to_output.to_stderr .and be_a_success end it "handles unavailable formula", :integration_test, :no_api do setup_test_formula "foo" setup_test_formula "bar" setup_test_formula "optional", <<~RUBY url "https://brew.sh/optional-1.0" depends_on "bar" => :optional RUBY expect_any_instance_of(Homebrew::CLI::NamedArgs) .to receive(:to_formulae) .and_raise(FormulaUnavailableError, "foo") cmd = described_class.new(%w[foo --eval-all --include-optional --recursive]) expect { cmd.run } .to output(/^(bar\noptional|optional\nbar)$/).to_stdout .and output(/Error: Missing formulae should not have dependents!\n/).to_stderr .and raise_error SystemExit end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/unalias_spec.rb
Library/Homebrew/test/cmd/unalias_spec.rb
# frozen_string_literal: true require "cmd/unalias" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Unalias do it_behaves_like "parseable arguments" it "unsets an alias", :integration_test do expect { brew "alias", "foo=bar" } .to not_to_output.to_stdout .and not_to_output.to_stderr .and be_a_success expect { brew "alias" } .to output(/brew alias foo='bar'/).to_stdout .and not_to_output.to_stderr .and be_a_success expect { brew "unalias", "foo" } .to not_to_output.to_stdout .and not_to_output.to_stderr .and be_a_success expect { brew "alias" } .to not_to_output.to_stdout .and not_to_output.to_stderr .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/reinstall_spec.rb
Library/Homebrew/test/cmd/reinstall_spec.rb
# frozen_string_literal: true require "extend/ENV" require "cmd/reinstall" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Reinstall do it_behaves_like "parseable arguments" it "reinstalls a Formula", :aggregate_failures, :integration_test do formula_name = "testball_bottle" formula_prefix = HOMEBREW_CELLAR/formula_name/"0.1" formula_bin = formula_prefix/"bin" setup_test_formula formula_name, tab_attributes: { installed_on_request: true } Keg.new(formula_prefix).link expect(formula_bin).not_to exist expect { brew "reinstall", formula_name } .to output(/Reinstalling #{formula_name}/).to_stdout .and output(/βœ”οΈŽ.*/m).to_stderr .and be_a_success expect(formula_bin).to exist FileUtils.rm_r(formula_bin) expect { brew "reinstall", "--ask", formula_name } .to output(/.*Formula\s*\(1\):\s*#{formula_name}.*/).to_stdout .and output(/βœ”οΈŽ.*/m).to_stderr .and be_a_success expect(formula_bin).to exist FileUtils.rm_r(formula_bin) expect { brew "reinstall", formula_name, { "HOMEBREW_FORBIDDEN_FORMULAE" => formula_name } } .to not_to_output(/#{Regexp.escape(formula_prefix)}/o).to_stdout .and output(/#{formula_name} was forbidden/).to_stderr .and be_a_failure expect(formula_bin).not_to exist end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false
Homebrew/brew
https://github.com/Homebrew/brew/blob/fe0a384e3a04605192726c149570fbe33a8996b0/Library/Homebrew/test/cmd/command_spec.rb
Library/Homebrew/test/cmd/command_spec.rb
# frozen_string_literal: true require "cmd/shared_examples/args_parse" require "cmd/command" RSpec.describe Homebrew::Cmd::Command do it_behaves_like "parseable arguments" it "returns the file for a given command", :integration_test do expect { brew "command", "info" } .to output(%r{#{Regexp.escape(HOMEBREW_LIBRARY_PATH)}/cmd/info.rb}o).to_stdout .and be_a_success end end
ruby
BSD-2-Clause
fe0a384e3a04605192726c149570fbe33a8996b0
2026-01-04T15:37:27.366412Z
false