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

26 lines
723 B
Ruby
Raw Normal View History

# 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) do
2018-09-06 08:29:14 +02:00
Cask::CaskLoader.load(cask_path("local-caffeine"))
end
2017-08-05 16:20:03 +02:00
let(:with_conflicts_with) do
2018-09-06 08:29:14 +02:00
Cask::CaskLoader.load(cask_path("with-conflicts-with"))
end
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 do
2018-09-06 08:29:14 +02:00
Cask::Installer.new(with_conflicts_with).install
end.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