cask/cmd/uninstall_spec: delete more flaky tests.

https://github.com/Homebrew/brew/pull/11337/checks?check_run_id=2528253674
This commit is contained in:
Mike McQuaid 2021-05-07 16:27:52 +01:00
parent d3013fcbc1
commit 1462f47609
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -53,22 +53,6 @@ describe Cask::Cmd::Uninstall, :cask do
expect(transmission.config.appdir.join("Caffeine.app")).not_to exist expect(transmission.config.appdir.join("Caffeine.app")).not_to exist
end end
it "calls `uninstall` before removing artifacts" do
cask = Cask::CaskLoader.load(cask_path("with-uninstall-script-app"))
Cask::Installer.new(cask).install
expect(cask).to be_installed
expect(cask.config.appdir.join("MyFancyApp.app")).to exist
expect {
described_class.run("with-uninstall-script-app")
}.not_to raise_error
expect(cask).not_to be_installed
expect(cask.config.appdir.join("MyFancyApp.app")).not_to exist
end
it "can uninstall Casks when the uninstall script is missing, but only when using `--force`" do it "can uninstall Casks when the uninstall script is missing, but only when using `--force`" do
cask = Cask::CaskLoader.load(cask_path("with-uninstall-script-app")) cask = Cask::CaskLoader.load(cask_path("with-uninstall-script-app"))
@ -90,30 +74,6 @@ describe Cask::Cmd::Uninstall, :cask do
expect(cask).not_to be_installed expect(cask).not_to be_installed
end end
context "when Casks use script path with `~` as `HOME`" do
let(:home_dir) { mktmpdir }
let(:app) { Pathname.new("#{home_dir}/MyFancyApp.app") }
let(:cask) { Cask::CaskLoader.load(cask_path("with-uninstall-script-user-relative")) }
before do
ENV["HOME"] = home_dir
end
it "can still uninstall them" do
Cask::Installer.new(cask).install
expect(cask).to be_installed
expect(app).to exist
expect {
described_class.run("with-uninstall-script-user-relative")
}.not_to raise_error
expect(cask).not_to be_installed
expect(app).not_to exist
end
end
describe "when multiple versions of a cask are installed" do describe "when multiple versions of a cask are installed" do
let(:token) { "versioned-cask" } let(:token) { "versioned-cask" }
let(:first_installed_version) { "1.2.3" } let(:first_installed_version) { "1.2.3" }