74 Commits

Author SHA1 Message Date
Patrick Linnane
e63c885033
Support Tahoe, drop Mojave and older
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-09-12 10:40:19 -07:00
Bevan Kay
69145c911d
cask/dsl/rename: add api support 2025-08-19 11:47:15 +10:00
Rylan Polster
8aabee74a6
Store cask API data for use in to_hash_with_variations 2025-08-11 22:06:07 -04:00
Rylan Polster
54b349bb89
Revert "Only generate cask variations for supported macOS configurations" 2025-06-12 11:53:01 -04:00
Rylan Polster
e5667cb5ae
Only generate cask variations for supported macOS configurations 2025-06-11 20:30:14 -04:00
Mike McQuaid
e9f55a8f71
tests: default to API mode enabled.
While we're here, also add `brew tests --no-parallel` which I relied
on during testing.

Pretty much anywhere we rely on a stubbed formula on disk to work: we
need to disable the API.
2025-06-10 15:53:27 +01:00
Bo Anderson
b8e2cddbbd
Preliminary macOS 26 (Tahoe) support 2025-06-09 21:41:49 +01:00
Sean Molenaar
756ba2ba59 Add Linux dependency check in cask.rb 2025-03-13 21:47:17 +01:00
apainintheneck
eead014ceb cask/cask: remove unnecessary tests
The `compact:` option got removed from `Cask::Cask#artifacts_list`
in 042d6cc97e886c6f2817500083cda6c856b5350a.
2025-02-06 20:13:19 -08:00
Carlo Cabrera
fe1f330e60
Revert "Deprecate installing casks/formulae from paths." 2024-09-27 10:17:04 +08:00
Mike McQuaid
bbdea29a0f
Deprecate installing casks/formulae from paths.
We've already disabled installing casks/formulae from URLs and we
regularly tell people not to install from paths so let's just deprecate
this behaviour entirely.

Even Homebrew developers do not need to work this way.
2024-09-26 20:25:07 +01:00
Rylan Polster
119e02ceb0
Cleanup tap_git_head and uninstall_flight_blocks?
Co-authored-by: Kevin <apainintheneck@gmail.com>
2024-07-09 13:22:00 -04:00
Rylan Polster
46cb7f2847
Update tests 2024-07-04 01:47:14 -04:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02:00
Kevin
7b2bfee363
Merge pull request #16903 from apainintheneck/prevent-unexpected-network-calls-in-tests
Prevent unexpected network calls in tests
2024-03-20 20:40:26 -07:00
apainintheneck
74aea8e92d spec_helper: add :no_api test scope
This sets the HOMEBREW_NO_INSTALL_FROM_API environment variable
to prevent the selected tests from using the API. We will need
this as we transition to having the API be enabled by default
when running the tests but it's also nice as a sanity check
with the :needs_utils_curl scope in a few places.
2024-03-19 22:18:02 -07:00
Bo Anderson
326bc3f889
Fix cask source checksum handling 2024-03-19 21:21:37 +00:00
apainintheneck
b66097fa3d spec_helper: add check for unexpected network calls
Any test that is not tagged as :needs_network and that makes
a call to an unapproved method in the `Utils::Curl` module
will raise an error unless that method gets mocked somehow.

tests: add exceptions for tests that use curl to download local files

These are acceptable ways to use curl in local, non-network tests.
For those edge cases we allow you to bypass the check with :needs_utils_curl.
2024-03-18 20:57:23 -07:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Douglas Eichelberger
26eda5a303
git grep -l '^describe' | xargs gsed -i 's|^describe|RSpec.describe|g' 2024-02-19 13:57:27 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Mike McQuaid
22553cd34a
Fix cask sharding issues
- Fix cask info output being incorrect
- Improve some code referring to casks as formulae
- Move livecheck cask fixtures to not shadow existing names
- Adjust the cask tap symlinking logic to make handling outdated
  shadowed casks significantly easier
- Fix various flaky tests caused by casks sharding logic
- Prefer longer paths when there's multiple formulae or casks in a tap
  with the same name rather than always using the first
2023-08-10 16:08:47 +01:00
Bo Anderson
ba02c669e1
Introduce CoreCaskTap class 2023-07-13 20:33:26 +01:00
hyuraku
de7152b7a3 rename Cask::outdated_versions 2023-06-19 22:09:01 +09:00
Markus Reiter
d2231086bd
Merge pull request #15420 from reitermarkus/simulate-system-with
Add `SimulateSystem::with`.
2023-05-14 21:41:20 +02:00
Markus Reiter
0d56b97b07
Add SimulateSystem::with. 2023-05-14 01:45:04 +02:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Bo Anderson
44f058edb5
Refactor formula, cask and Ruby source downloads to use shared code 2023-04-27 23:23:07 +01:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Markus Reiter
3275b927b8
Make test not depend on macOS version. 2023-04-11 21:02:10 +02:00
apainintheneck
801ee5e474 Address feedback
- style nits
- better comments for tests that are not idempotent
- moved appdir placeholder constant to global.rb
2023-03-22 19:43:49 -07:00
apainintheneck
38146893c3 api_hashable: Make API path subs generic
This turns the ability to replace common paths with placeholders
into a mixin that can be used with both Casks and Formulae.

The idea here is to make formula hash generation more consistent.
2023-03-21 23:20:42 -07:00
Issy Long
865e99c611
test/cask: Rename 'expected_json_ventura' since it's >= Ventura
- Let's actually show in the fixtures JSON filename what's changed
  between the two.
2023-03-18 15:16:23 +00:00
Issy Long
6b4b923b44
test/cask: Fix "System Settings" caveats for (non-)Ventura OSes
- "System Preferences" was updated to be "System Settings" in macOS
  Ventura. This naming was updated in our caveats generator in PR 14997.
- This test was failing for me locally (on Ventura) because it was
  hardcoded to expect `System Preferences => Security & Privacy`, but
  getting `System Settings => Privacy & Security`.
- This is not the most important thing in the world, we can probably
  live with the failing test, but I thought I'd try to fix it anyway.
2023-03-18 13:19:20 +00:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
Issy Long
734a651f93
rubocop: Enable Layout/MultilineMethodCallIndentation & fix offenses
- Part of trying to reduce the number of `Excludes:` we have in our
  RuboCop configs.
- The fixes here all seemed reasonable, with some minimal tweaks for
  line length and less floatiness. Apart from `test/dev-cmd/bottle_spec.rb`
  where RuboCop wanted to do some ridiculously floaty indentation and there
  wasn't an obvious alternative place to break the lines, so I opted for
  in-line disables instead.
2023-03-03 22:18:51 +00:00
apainintheneck
9087afba74 Add baseline test for Cask#to_h
Also, added a test for loading JSON files in the cask loader.
2023-02-28 21:43:02 -08:00
Bo Anderson
6e1b9ddb49
test/cask/cask_spec: fix test 2023-02-15 04:59:07 +00:00
Mike McQuaid
237eec8ef8
Overhaul Formula/Cask JSON generation
- Use constants for placeholders
- Monkeypatch to set `HOMEBREW_PREFIX` consistently to placeholder
- Use environment variable to set `Dir.home` consistently to placeholder
- Use `appdir` short-circuit to set `Cask#appdir` consistently to placeholder
- Use `Cask.generating_hash!` to enable "generating mode" with these patches
- Fix `Formula#caveats` from JSON

Fixes #14505
Fixes #14595
2023-02-14 14:19:40 +00:00
apainintheneck
39c6f7d6fb Stop including *flight block source in cask API
Originally we were going to try and load the *flight blocks from the API
but we ended up going with downloading the caskfile for the subset of
casks that need this functionality for consisty's sake.

This reverts the following commits from most recent to oldest:
- ffc74a51fb32b66a4cd8bc41dbd076dd23d9100e
- e5616e94fe42505434c330be35eeafef2739944f
- d1490c3d5c087d00f2bca1787cce331202b195c5
- 7ca5a5d9a71a73f21bbb8555a38048f027bee89b
- 2d5d132713d0701d02d5ff33e9918812d13d2a83

It also changes how *flight blocks are handled in `.to_h`.
Essentially, when *flight blocks exist they are just included
as a hash of the artifact to nil to indicate that they exist.

More information isn't necessary since we don't evaluate
the current source code in the *flight artifacts that
we get from the API.
2023-02-13 21:22:18 -08:00
Rylan Polster
7ca5a5d9a7
Simplify require "method_source" calls 2023-01-02 17:41:36 -05:00
Rylan Polster
2d5d132713
Include *flight block source in cask API 2023-01-02 14:33:33 -05:00
Mike McQuaid
7349c2b996
brew style --fix 2022-09-13 09:43:09 +01:00
Rylan Polster
686e02b7ce
Add arm: and intel: arguments to cask sha256 stanza 2022-08-16 00:48:24 -04:00
Rylan Polster
19c955d19a
Fix tests 2022-08-09 14:54:33 -04:00
Rylan Polster
76ae20a12f
Re-add on_arch_conditional DSL 2022-08-09 11:34:52 -04:00
Rylan Polster
6c35317732
Add and update tests 2022-07-21 16:41:23 +02:00
Bevan Kay
e64ab4c0f7
Fix test 2022-05-30 18:30:18 +10:00