We used the binary artifact as an example of an unsigned artifact
before in this test. Now that we're adding it as a signed artifact
the test has been updated with another example of an unsigned one.
As I mentioned in #15146, two `Cask::DSL` tests failed on my local
machine, even on `master`. `git bisect` suggested that it was #14998
that introduced those failures. It turned out that the tests here could
fail under certain locale settings, like this one below:
$ defaults read -g AppleLanguages
(
"en-GB",
"zh-Hans-SG"
)
This is not actually a regression. With the aforementioned locale
settings, an explicit `let(:languages) { ["en"] }` setting would result
in locales being considered in the following order: `en`, `en-GB`,
`zh-Hans-SG`. For each of them, the `detect` method from `Locale` is
called, with `locale_groups` as `[["zh"], ["en-US"]]`, the list of
locales defined in the test cask.
def detect(locale_groups)
locale_groups.find { |locales| locales.any? { |locale| eql?(locale) } } ||
locale_groups.find { |locales| locales.any? { |locale| include?(locale) } }
end
Neither of `en` and `en-GB` satisfies the `detect` conditions. (Note
that `Locale.parse("en").include?("en-US")` evaluates to `false`.) But
`zh-Hans-SG` does (because `Locale.parse("zh-Hans-SG").include?("zh")`
is `true`). So, despite having `:languages` set to `en`, the Chinese
locale was still used.
This could be fixed by generalising the test cask's English locale
settings from `en-US` to `en`. This is already the case for most
existing casks:
$ grep 'language "en.*", default: true' Casks/*.rb
Casks/battle-net.rb: language "en", default: true do
Casks/cave-story.rb: language "en", default: true do
Casks/firefox.rb: language "en", default: true do
Casks/libreoffice-language-pack.rb: language "en-GB", default: true do
Casks/libreoffice-language-pack.rb: language "en-GB", default: true do
Casks/openoffice.rb: language "en", default: true do
Casks/seamonkey.rb: language "en-US", default: true do
Casks/thunderbird.rb: language "en", default: true do
Casks/wondershare-edrawmax.rb: language "en", default: true do
Note that this should make the language stanza tests independent of
locale settings, because `zh` and `en` should be able to capture all the
test cases.
Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
- Specify `strictish: true` in `add_error` to specify that it's not a
super big critical error.
- These will be shown only if `brew audit --strict` is requested.
- Ignore them and don't show them otherwise.
- Part three of issue 15074:
> As a result, I propose that all current cask audit warnings are never
> displayed as warnings but the underlying audit checks turned into
> errors displayed only with --strict (or one of the other relevant
> flags).
- Cask warnings are really noisy and numerous. Let's only show them if
the user passes `--strict` or something implying `--strict`, like
`--new-cask`.
- Additionally remove `display_passes` since we would like silence if
nothing is wrong with the cask, the same as with formula audits.
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.
- "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.
- 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.
Set metadata when we load casks from the source API.
Set `@tap_git_head` manually.
Also, allow `auto_update` to receive false.
This is only done for consistency.
Stop double printing the `kext` caveat.
Handle Array elements correctly when substituting
path elements in artifacts. This affected how the
Uninstall Signal keys were evaluated (they are
represented as arrays of arrays).
For casks with certain stanzas, *flight and language
stanzas in this case, we need to use the caskfile
to install them correctly. The JSON API is not an option.
This delays loading from the source API until just before
we try to install one of these casks. This reduces the
number of requests we make to the source API.