Add spec for conflicts_with cask.
This commit is contained in:
parent
67327c75b5
commit
f89e09b785
23
Library/Homebrew/test/cask/conflicts_with_spec.rb
Normal file
23
Library/Homebrew/test/cask/conflicts_with_spec.rb
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
describe "conflicts_with", :cask do
|
||||||
|
describe "conflicts_with cask" do
|
||||||
|
let(:local_caffeine) {
|
||||||
|
Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb")
|
||||||
|
}
|
||||||
|
|
||||||
|
let(:with_conflicts_with) {
|
||||||
|
Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-conflicts-with.rb")
|
||||||
|
}
|
||||||
|
|
||||||
|
it "installs the dependency of a Cask and the Cask itself", :focus do
|
||||||
|
Hbc::Installer.new(local_caffeine).install
|
||||||
|
|
||||||
|
expect(local_caffeine).to be_installed
|
||||||
|
|
||||||
|
expect {
|
||||||
|
Hbc::Installer.new(with_conflicts_with).install
|
||||||
|
}.to raise_error(Hbc::CaskConflictError, "Cask 'with-conflicts-with' conflicts with 'local-caffeine'.")
|
||||||
|
|
||||||
|
expect(with_conflicts_with).not_to be_installed
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -5,7 +5,7 @@ cask 'with-conflicts-with' do
|
|||||||
url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip"
|
url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip"
|
||||||
homepage 'http://example.com/with-conflicts-with'
|
homepage 'http://example.com/with-conflicts-with'
|
||||||
|
|
||||||
conflicts_with formula: 'unar'
|
conflicts_with cask: 'local-caffeine'
|
||||||
|
|
||||||
app 'Caffeine.app'
|
app 'Caffeine.app'
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user