Merge pull request #11343 from MikeMcQuaid/delete-flaky-test

cask/cmd/uninstall_spec: delete more flaky tests.
This commit is contained in:
Mike McQuaid 2021-05-07 17:27:46 +01:00 committed by GitHub
commit 5b4c4417c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,22 +53,6 @@ describe Cask::Cmd::Uninstall, :cask do
expect(transmission.config.appdir.join("Caffeine.app")).not_to exist
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
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
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
let(:token) { "versioned-cask" }
let(:first_installed_version) { "1.2.3" }