67 Commits

Author SHA1 Message Date
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Douglas Eichelberger
f664433b5c Enable RSpec/DescribeClass 2024-04-03 09:12:47 -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
Markus Reiter
d42f419217
Don't use slashes when loading casks in tests. 2024-02-09 23:17:25 +01:00
Markus Reiter
4d8b3784db
Remove unnecessary to_s. 2024-02-09 22:02:00 +01:00
Patrick Linnane
50b0940c72
various: fix future tense in tests
Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-01-08 18:41:30 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00: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
Ruoyu Zhong
1dd2e0cd7f
test/cask/dsl_spec: fix test for certain locale settings
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>
2023-04-13 11:27:20 +08:00
Issy Long
7cfa544aec
cask/utils: Make more noise when encountering undefined methods
- https://github.com/Homebrew/homebrew-cask/actions/runs/4608585102/jobs/8144571098
  introduced syntax errors for the `mattermost` cask (`autoupdates`
  instead of `auto_updates`), but CI didn't fail so we didn't notice
  until it shipped to users and broke `brew update`.
2023-04-04 17:08:54 +01:00
Markus Reiter
bdd6523ce8
Deprecate appcast. 2023-03-30 03:29:06 +02: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
Rylan Polster
686e02b7ce
Add arm: and intel: arguments to cask sha256 stanza 2022-08-16 00:48:24 -04:00
Rylan Polster
76ae20a12f
Re-add on_arch_conditional DSL 2022-08-09 11:34:52 -04:00
Rylan Polster
dd72f1ac95
Add arch cask DSL 2022-08-05 17:12:55 -04:00
Issy Long
6b76fd012a
Fix (auto-correct) RuboCop RSpec/BeNil offenses 2022-03-01 00:10:10 +00:00
Bo Anderson
4836ea0ba2
Remove XQuartz handling 2021-11-05 12:40:22 +00:00
Issy Long
5793be5b86
test: Change more contexts to describes for better sentences
- We could have added "to" to the `RSpec/ContextWording` list of valid
  `context` prefixes, but switching these to `describe` is less special.
2021-02-21 13:31:26 +00:00
Issy Long
e1ad07190e
rubocop: Fix RSpec/ContextWording offenses
- For some of these I changed `context` to `describe` as it fit better
  rather than contriving a "when", "with" or "without", or massively
  restructuring the tests.
2021-02-19 23:30:41 +00:00
Bo Anderson
323ff660fa rubocop: use consistent array/hash indentation 2021-02-11 13:27:42 +00:00
Mike McQuaid
010ae37420
Merge pull request #9403 from MikeMcQuaid/deprecate-cask-requirements
Deprecate cask requirements.
2020-12-18 12:15:35 +00:00
Markus Reiter
44cf1041ac Fix tests. 2020-12-16 09:45:58 +01:00
Mike McQuaid
87dd13aea6
Deprecate cask requirements.
This probably has to wait until 2.7.0 now and will require a bunch of
formula changes/deprecations but we should probably start moving in this
direction given we're not installing any of these on our CI any more.
2020-12-15 14:19:45 +00:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
5f005f67cf Refactor global Cask::Config. 2020-10-01 00:57:10 +02:00
Waldir Pimenta
ffed8fdbb3 Add a desc stanza to the cask DSL 2020-08-08 23:02:23 +01:00
Markus Reiter
8d148b1fbc Remove special-casing of MacOS::languages. 2020-07-22 01:09:14 +02:00
Mike McQuaid
8a93230c15
test/cask: remove disabled functionality tests. 2019-10-15 09:52:33 +01:00
Mike McQuaid
1b4fdc17f4
Raise deprecation exceptions in tests
Previously tests which hit `odeprecated` would print warnings but not
always raise exceptions or fail. Combine this with the ability to have
`odeprecated` to turn into `odisabled` on certain dates and you have
tests that may fail just on the clock changing (this is bad).

Instead, ensure that tests always raise deprecations as exceptions so
that new deprecations will have their tests handled immediately.
2019-10-15 08:52:42 +01:00
Issy Long
341ea60807
Auto-fix Style/RedundantBegin offenses
- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
  Layout/InconsistentIndentation once the auto-fixer had got rid of the
  "redundant begin"s.
2019-10-13 16:04:27 +01:00
Markus Reiter
b1d0c61fea Update Gems. 2019-10-03 09:22:44 +02:00
Markus Reiter
16d2f8264c Use MacOSRequirement for casks. 2019-08-21 06:57:21 +02:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Markus Reiter
1e1ce1c471 Save config file for casks. 2019-02-15 10:09:14 +01:00
Markus Reiter
d22c2eca9e Refactor ConflictsWith to be a DelegateClass(Hash). 2019-01-27 21:48:12 +01:00
Claudia
5be80a78f6
Use Homebrew-controlled domain for Cask dummy URLs
In a number of Cask specs, the value of the `homepage` stanza is currently set
to https://example.com. As of 2018-11-28, the TLS certificate served by
example.com seems to be expired, possibly due to an oversight on ICANN’s side.

While the certificate is certainly going to be renewed soon, it would be
desirable for Homebrew’s test result to be less dependent on ICANN’s actions.
This commit changes the homepages of all test Casks to http://brew.sh, whose
domain and TLS certificate are both controlled by Homebrew.
2018-11-28 20:51:55 +01:00
Markus Reiter
c4d418e126 Use ActiveSupport’s #second. 2018-10-07 23:10:56 +02:00
Markus Reiter
a84a1c63db Rename Hbc module to Cask. 2018-09-06 09:30:52 +02:00
Markus Reiter
89dd608766 Deprecate gpg stanza. 2018-09-03 20:47:52 +02:00
Reto Kromer
456571b15d fix more insecure protocols 2018-08-06 16:50:42 +02:00
Markus Reiter
785ec4ef57 Add tests for `CaskUnreadableError. 2018-07-29 12:03:42 +02:00
Mike McQuaid
5c6ef3d920 Disable more deprecations.
- Turn more old `odeprecated` into `odisabled`
- Remove more old `odisabled`
- Remove code for older Ruby versions
2018-07-14 16:00:50 +01:00
Markus Reiter
20ec595cb2 Fix Installer not supporting plain executables. 2018-07-11 16:56:37 +02:00
Markus Reiter
44f56a0773 Refactor join("") to join. 2018-06-15 13:56:08 +02:00
Markus Reiter
de246cc528 Update Homebrew-Cask references. 2018-05-25 18:20:02 +02:00
Markus Reiter
c4222141ac Revert "Update Homebrew-Cask references."
This reverts commit 4475651b548afdcf15c4cf7a7cb57baca1885186.
2018-05-25 17:57:32 +02:00
Markus Reiter
4475651b54 Update Homebrew-Cask references. 2018-05-25 17:56:16 +02:00
Markus Reiter
791af7e910 Move invalid Cask fixtures into sub-directories. 2018-04-14 11:44:19 +02:00