homebrew-cask-versions/test/cask/artifact/pkg_test.rb
Roland Walker 202d6019f8 Move all code under an Hbc:: namespace
* convert existing Cask:: namespace to Hbc::
* move Homebrew-fork code under Hbc::
* move freestanding classes such as Tty and TopologicalHash under Hbc::
* recast HOMEBREW_CASK_ constants as HBC_
* modify our Homebrew Formula for backward compatibility
* devscripts and dev docs
2015-01-02 07:27:03 -05:00

31 lines
823 B
Ruby

require 'test_helper'
describe Hbc::Artifact::Pkg do
before {
@cask = Hbc.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 = Hbc::Artifact::Pkg.new(@cask, Hbc::FakeSystemCommand)
Hbc::FakeSystemCommand.expects_command(['/usr/bin/sudo', '-E', '--', '/usr/sbin/installer', '-pkg', @cask.staged_path.join('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 = Hbc::Artifact::Pkg.new(@cask, Hbc::FakeSystemCommand)
shutup do
pkg.uninstall_phase
end
end
end
end