Merge pull request #20366 from Homebrew/livecheck/special-case-unsigned-deprecations
SkipConditions: special case unsigned deprecations
This commit is contained in:
commit
9e4bedad2f
@ -120,6 +120,7 @@ module Homebrew
|
||||
}
|
||||
private_class_method def self.cask_deprecated(cask, livecheck_defined, full_name: false, verbose: false)
|
||||
return {} if !cask.deprecated? || livecheck_defined
|
||||
return {} if cask.disable_date && cask.deprecation_reason == :unsigned
|
||||
|
||||
Livecheck.status_hash(cask, "deprecated", full_name:, verbose:)
|
||||
end
|
||||
|
@ -82,7 +82,7 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
basic: Cask::Cask.new("test") do
|
||||
version "0.0.1,2"
|
||||
|
||||
url "https://brew.sh/test-0.0.1.tgz"
|
||||
url "https://brew.sh/test-#{version.csv.first}.tgz"
|
||||
name "Test"
|
||||
desc "Test cask"
|
||||
homepage "https://brew.sh"
|
||||
@ -96,7 +96,7 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
version "0.0.1"
|
||||
sha256 :no_check
|
||||
|
||||
url "https://brew.sh/test-0.0.1.tgz"
|
||||
url "https://brew.sh/test-#{version}.tgz"
|
||||
name "Test Deprecate"
|
||||
desc "Deprecated test cask"
|
||||
homepage "https://brew.sh"
|
||||
@ -107,17 +107,27 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
version "0.0.1"
|
||||
sha256 :no_check
|
||||
|
||||
url "https://brew.sh/test-0.0.1.tgz"
|
||||
url "https://brew.sh/test-#{version}.tgz"
|
||||
name "Test Disable"
|
||||
desc "Disabled test cask"
|
||||
homepage "https://brew.sh"
|
||||
|
||||
disable! date: "2020-06-25", because: :discontinued
|
||||
end,
|
||||
future_disable_unsigned: Cask::Cask.new("test_future_disable_unsigned") do
|
||||
version "0.0.1"
|
||||
|
||||
url "https://brew.sh/test-#{version}.tgz"
|
||||
name "Test Future Disabled Unsigned"
|
||||
desc "Future Disable Unsigned test cask"
|
||||
homepage "https://brew.sh"
|
||||
|
||||
disable! date: "3000-06-25", because: :unsigned
|
||||
end,
|
||||
extract_plist: Cask::Cask.new("test_extract_plist_skip") do
|
||||
version "0.0.1"
|
||||
|
||||
url "https://brew.sh/test-0.0.1.tgz"
|
||||
url "https://brew.sh/test-#{version}.tgz"
|
||||
name "Test ExtractPlist Skip"
|
||||
desc "Skipped test cask"
|
||||
homepage "https://brew.sh"
|
||||
@ -147,7 +157,7 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
skip: Cask::Cask.new("test_skip") do
|
||||
version "0.0.1"
|
||||
|
||||
url "https://brew.sh/test-0.0.1.tgz"
|
||||
url "https://brew.sh/test-#{version}.tgz"
|
||||
name "Test Skip"
|
||||
desc "Skipped test cask"
|
||||
homepage "https://brew.sh"
|
||||
@ -159,7 +169,7 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
skip_with_message: Cask::Cask.new("test_skip_with_message") do
|
||||
version "0.0.1"
|
||||
|
||||
url "https://brew.sh/test-0.0.1.tgz"
|
||||
url "https://brew.sh/test-#{version}.tgz"
|
||||
name "Test Skip"
|
||||
desc "Skipped test cask"
|
||||
homepage "https://brew.sh"
|
||||
@ -374,6 +384,12 @@ RSpec.describe Homebrew::Livecheck::SkipConditions do
|
||||
end
|
||||
end
|
||||
|
||||
context "when a cask without a `livecheck` block is deprecated with a future disable date because `:unsigned`" do
|
||||
it "does not skip" do
|
||||
expect(skip_conditions.skip_information(casks[:future_disable_unsigned])).to eq({})
|
||||
end
|
||||
end
|
||||
|
||||
context "when a cask has a `livecheck` block using `ExtractPlist` and `--extract-plist` is not used" do
|
||||
it "skips" do
|
||||
expect(skip_conditions.skip_information(casks[:extract_plist], extract_plist: false))
|
||||
|
Loading…
x
Reference in New Issue
Block a user