diff --git a/Library/Homebrew/cask/lib/hbc/artifact/uninstall.rb b/Library/Homebrew/cask/lib/hbc/artifact/uninstall.rb index 8b5603064e..5a3dc098d9 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/uninstall.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/uninstall.rb @@ -3,6 +3,9 @@ require "hbc/artifact/uninstall_base" module Hbc module Artifact class Uninstall < UninstallBase + def uninstall_phase + dispatch_uninstall_directives + end end end end diff --git a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb index e18e9c3115..ce2b1f51a1 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb @@ -54,10 +54,6 @@ module Hbc path_strings - undeletable end - def uninstall_phase - dispatch_uninstall_directives - end - def dispatch_uninstall_directives(expand_tilde: true) directives_set = @cask.artifacts[stanza] ohai "Running #{stanza} process for #{@cask}; your password may be necessary" diff --git a/Library/Homebrew/cask/lib/hbc/artifact/zap.rb b/Library/Homebrew/cask/lib/hbc/artifact/zap.rb index b31e2ef11a..7793e57728 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/zap.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/zap.rb @@ -3,7 +3,7 @@ require "hbc/artifact/uninstall_base" module Hbc module Artifact class Zap < UninstallBase - def uninstall_phase + def zap_phase dispatch_uninstall_directives(expand_tilde: true) end end diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb index 776a3acd28..cafc9d8b9e 100644 --- a/Library/Homebrew/cask/lib/hbc/installer.rb +++ b/Library/Homebrew/cask/lib/hbc/installer.rb @@ -331,7 +331,7 @@ module Hbc uninstall_artifacts if Artifact::Zap.me?(@cask) ohai "Dispatching zap stanza" - Artifact::Zap.new(@cask, command: @command).uninstall_phase + Artifact::Zap.new(@cask, command: @command).zap_phase else opoo "No zap stanza present for Cask '#{@cask}'" end diff --git a/Library/Homebrew/cask/spec/cask/artifact/uninstall_no_zap_spec.rb b/Library/Homebrew/cask/spec/cask/artifact/uninstall_no_zap_spec.rb new file mode 100644 index 0000000000..3150b50bee --- /dev/null +++ b/Library/Homebrew/cask/spec/cask/artifact/uninstall_no_zap_spec.rb @@ -0,0 +1,21 @@ +require "spec_helper" + +describe Hbc::Artifact::Zap do + let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-installable.rb") } + + let(:zap_artifact) { + Hbc::Artifact::Zap.new(cask) + } + + before do + shutup do + InstallHelper.install_without_artifacts(cask) + end + end + + describe "#uninstall_phase" do + subject { zap_artifact } + + it { is_expected.not_to respond_to(:uninstall_phase) } + end +end diff --git a/Library/Homebrew/cask/test/cask/artifact/zap_test.rb b/Library/Homebrew/cask/test/cask/artifact/zap_test.rb index ea546728b5..37a65f863e 100644 --- a/Library/Homebrew/cask/test/cask/artifact/zap_test.rb +++ b/Library/Homebrew/cask/test/cask/artifact/zap_test.rb @@ -14,10 +14,10 @@ describe Hbc::Artifact::Zap do end end - describe "uninstall_phase" do + describe "#zap_phase" do subject { shutup do - zap_artifact.uninstall_phase + zap_artifact.zap_phase end }