forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing test coverage for
suite
artifact
refs: Homebrew#7382
- Loading branch information
1 parent
a21dbc8
commit 000e251
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
require 'test_helper' | ||
|
||
describe Cask::Artifact::Suite do | ||
let(:cask) { | ||
Cask.load('with-suite').tap do |cask| | ||
TestHelper.install_without_artifacts(cask) | ||
end | ||
} | ||
let(:expected_path) { | ||
Cask.appdir/'caffeine_suite' | ||
} | ||
|
||
it "links the suite to the proper directory" do | ||
shutup do | ||
Cask::Artifact::Suite.new(cask).install_phase | ||
end | ||
|
||
TestHelper.valid_alias?(expected_path).must_equal true | ||
end | ||
|
||
it "creates a suite containing the expected app" do | ||
shutup do | ||
Cask::Artifact::Suite.new(cask).install_phase | ||
end | ||
|
||
expected_path.join('Caffeine.app').must_be :exist? | ||
end | ||
|
||
it "avoids clobbering an existing suite by linking over it" do | ||
FileUtils.touch expected_path | ||
|
||
shutup do | ||
Cask::Artifact::Suite.new(cask).install_phase | ||
end | ||
|
||
expected_path.wont_be :symlink? | ||
end | ||
|
||
it "clobbers an existing symlink" do | ||
expected_path.make_symlink('/tmp') | ||
|
||
shutup do | ||
Cask::Artifact::Suite.new(cask).install_phase | ||
end | ||
|
||
File.readlink(expected_path).wont_equal '/tmp' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class WithSuite < TestCask | ||
version '1.2.3' | ||
sha256 'd1302a0dc25aff72ad395ed01a830468b92253ffd28269574f3ac0b5eb8aad54' | ||
|
||
url TestHelper.local_binary_url('caffeine_suite.zip') | ||
homepage 'http://example.com/with-suite' | ||
|
||
suite 'caffeine_suite' | ||
end |
Binary file not shown.