aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-08-05 16:20:03 +0200
committerMarkus Reiter2017-08-05 16:21:14 +0200
commitf89e09b7857e8e3a6f6cd30258aa5927a1ac2872 (patch)
treea4d38ed10f2682a7eed2a0ca386425b8c8ebd216 /Library
parent67327c75b56cbf9ab8a506879846118b9d3526ab (diff)
downloadbrew-f89e09b7857e8e3a6f6cd30258aa5927a1ac2872.tar.bz2
Add spec for `conflicts_with cask`.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/cask/conflicts_with_spec.rb23
-rw-r--r--Library/Homebrew/test/support/fixtures/cask/Casks/with-conflicts-with.rb2
2 files changed, 24 insertions, 1 deletions
diff --git a/Library/Homebrew/test/cask/conflicts_with_spec.rb b/Library/Homebrew/test/cask/conflicts_with_spec.rb
new file mode 100644
index 000000000..0dc51cb2d
--- /dev/null
+++ b/Library/Homebrew/test/cask/conflicts_with_spec.rb
@@ -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
diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-conflicts-with.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-conflicts-with.rb
index ab3631743..13d1fc4fc 100644
--- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-conflicts-with.rb
+++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-conflicts-with.rb
@@ -5,7 +5,7 @@ cask 'with-conflicts-with' do
url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip"
homepage 'http://example.com/with-conflicts-with'
- conflicts_with formula: 'unar'
+ conflicts_with cask: 'local-caffeine'
app 'Caffeine.app'
end