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`.
This commit is contained in:
Issy Long 2023-04-04 17:00:54 +01:00
parent 41e7ee7b51
commit 7cfa544aec
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 3 additions and 3 deletions

View File

@ -104,7 +104,7 @@ module Cask
message << "during #{section} " if section message << "during #{section} " if section
message << "on Cask #{token}." message << "on Cask #{token}."
opoo "#{message}\n#{error_message_with_suggestions}" ofail "#{message}\n#{error_message_with_suggestions}"
end end
end end
end end

View File

@ -20,10 +20,10 @@ describe Cask::DSL, :cask do
end end
end end
it "prints a warning that it has encountered an unexpected method" do it "prints an error that it has encountered an unexpected method" do
expected = Regexp.compile(<<~EOS.lines.map(&:chomp).join) expected = Regexp.compile(<<~EOS.lines.map(&:chomp).join)
(?m) (?m)
Warning: Error:
.* .*
Unexpected method 'future_feature' called on Cask unexpected-method-cask\\. Unexpected method 'future_feature' called on Cask unexpected-method-cask\\.
.* .*