brew/Library/Homebrew/test/cask/conflicts_with_spec.rb

27 lines
729 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
2017-08-05 16:20:03 +02:00
describe "conflicts_with", :cask do
describe "conflicts_with cask" do
let(:local_caffeine) {
2018-09-06 08:29:14 +02:00
Cask::CaskLoader.load(cask_path("local-caffeine"))
2017-08-05 16:20:03 +02:00
}
let(:with_conflicts_with) {
2018-09-06 08:29:14 +02:00
Cask::CaskLoader.load(cask_path("with-conflicts-with"))
2017-08-05 16:20:03 +02:00
}
2017-08-04 14:59:18 +02:00
it "installs the dependency of a Cask and the Cask itself" do
2018-09-06 08:29:14 +02:00
Cask::Installer.new(local_caffeine).install
2017-08-05 16:20:03 +02:00
expect(local_caffeine).to be_installed
expect {
2018-09-06 08:29:14 +02:00
Cask::Installer.new(with_conflicts_with).install
}.to raise_error(Cask::CaskConflictError, "Cask 'with-conflicts-with' conflicts with 'local-caffeine'.")
2017-08-05 16:20:03 +02:00
expect(with_conflicts_with).not_to be_installed
end
end
end