Merge pull request #20517 from Homebrew/copilot/fix-20516
Fix conflicts_with stanza odeprecated method call issue
This commit is contained in:
commit
eae11bfe91
@ -23,7 +23,7 @@ module Cask
|
|||||||
options.assert_valid_keys(*VALID_KEYS, *ODEPRECATED_KEYS)
|
options.assert_valid_keys(*VALID_KEYS, *ODEPRECATED_KEYS)
|
||||||
|
|
||||||
options.keys.intersection(ODEPRECATED_KEYS).each do |key|
|
options.keys.intersection(ODEPRECATED_KEYS).each do |key|
|
||||||
odeprecated "conflicts_with #{key}:"
|
Kernel.odeprecated "conflicts_with #{key}:"
|
||||||
end
|
end
|
||||||
|
|
||||||
conflicts = options.transform_values { |v| Set.new(Kernel.Array(v)) }
|
conflicts = options.transform_values { |v| Set.new(Kernel.Array(v)) }
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
# typed: strict
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Cask
|
|
||||||
class DSL
|
|
||||||
class ConflictsWith < SimpleDelegator
|
|
||||||
include Kernel
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -501,6 +501,14 @@ RSpec.describe Cask::DSL, :cask, :no_api do
|
|||||||
expect { cask }.to raise_error(Cask::CaskInvalidError)
|
expect { cask }.to raise_error(Cask::CaskInvalidError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with deprecated conflicts_with key" do
|
||||||
|
let(:token) { "conflicts-with-deprecated-key" }
|
||||||
|
|
||||||
|
it "loads but shows deprecation warning for deprecated key" do
|
||||||
|
expect { cask.conflicts_with }.to raise_error(Cask::CaskInvalidError, /is deprecated/)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "installer stanza" do
|
describe "installer stanza" do
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
cask "conflicts-with-deprecated-key" do
|
||||||
|
version "1.2.3"
|
||||||
|
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||||
|
|
||||||
|
url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip"
|
||||||
|
homepage "https://brew.sh/conflicts-with-deprecated-key"
|
||||||
|
|
||||||
|
conflicts_with formula: "some-formula"
|
||||||
|
|
||||||
|
app "Caffeine.app"
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user