homebrew-cask-versions/test/cask/artifact/pkg_test.rb
Roland Walker 967aa22793 recast method destination_path as staged_path
* part of DSL 1.0 review
* `destination_path` was always a bit vague (it refers to
  Cask-specific, version-specific location under
  `/opt/homebrew-cask/Caskroom`)
* here renamed `staged_path` to match upcoming command verb
  `brew cask stage`
* rename also intended to reduce confusion when we implement
  copying as a configurable alternative to symlinking
* transitional `destination_path` methods to remain while
  Casks are converted (this was documented as a part of the
  DSL, and used by 39 Casks in main repo)
* unrelated variables containing "stage" recast for clarity
2014-10-18 12:23:36 -04:00

31 lines
824 B
Ruby

require 'test_helper'
describe Cask::Artifact::Pkg do
before {
@cask = Cask.load('with-installable')
shutup do
TestHelper.install_without_artifacts(@cask)
end
}
describe 'install_phase' do
it 'runs the system installer on the specified pkgs' do
pkg = Cask::Artifact::Pkg.new(@cask, Cask::FakeSystemCommand)
Cask::FakeSystemCommand.expects_command(['/usr/bin/sudo', '-E', '--', '/usr/sbin/installer', '-pkg', @cask.staged_path/'MyFancyPkg'/'Fancy.pkg', '-target', '/'])
shutup do
pkg.install_phase
end
end
end
describe 'uninstall_phase' do
it 'does nothing, because the uninstall_phase method is a no-op' do
pkg = Cask::Artifact::Pkg.new(@cask, Cask::FakeSystemCommand)
shutup do
pkg.uninstall_phase
end
end
end
end