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.
This commit is contained in:
Mike McQuaid 2019-10-15 08:52:42 +01:00
parent 8fa65aaabf
commit 1b4fdc17f4
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
2 changed files with 3 additions and 2 deletions

View File

@ -335,11 +335,11 @@ describe Cask::DSL, :cask do
end
describe "depends_on macos" do
context "valid", :needs_compat do
context "string disabled", :needs_compat do
let(:token) { "compat/with-depends-on-macos-string" }
it "allows depends_on macos to be specified" do
expect(cask.depends_on.macos).not_to be nil
expect { cask }.to raise_error(Cask::CaskInvalidError)
end
end

View File

@ -144,6 +144,7 @@ RSpec.configure do |config|
end
begin
Homebrew.raise_deprecation_exceptions = true
Tap.clear_cache
FormulaInstaller.clear_attempted