Fix conflicts_with stanza odeprecated method call issue

Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-08-19 17:07:37 +01:00 committed by Mike McQuaid
parent d82f30290e
commit 8b10231085
No known key found for this signature in database
4 changed files with 20 additions and 11 deletions

View File

@ -23,7 +23,7 @@ module Cask
options.assert_valid_keys(*VALID_KEYS, *ODEPRECATED_KEYS)
options.keys.intersection(ODEPRECATED_KEYS).each do |key|
odeprecated "conflicts_with #{key}:"
Kernel.odeprecated "conflicts_with #{key}:"
end
conflicts = options.transform_values { |v| Set.new(Kernel.Array(v)) }

View File

@ -1,10 +0,0 @@
# typed: strict
# frozen_string_literal: true
module Cask
class DSL
class ConflictsWith < SimpleDelegator
include Kernel
end
end
end

View File

@ -501,6 +501,14 @@ RSpec.describe Cask::DSL, :cask, :no_api do
expect { cask }.to raise_error(Cask::CaskInvalidError)
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
describe "installer stanza" do

View File

@ -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