Add test for zap :login_item

This commit is contained in:
Josh Hagins 2015-12-11 23:55:04 -05:00
parent 3db0ad8ddf
commit 64d142af6e
2 changed files with 3 additions and 0 deletions

View File

@ -37,6 +37,8 @@ describe Hbc::Artifact::Zap do
Hbc::FakeSystemCommand.stubs_command(['/usr/bin/sudo', '-E', '--', '/usr/bin/osascript', '-e', 'tell application "System Events" to count processes whose bundle identifier is "my.fancy.package.app"'], '1')
Hbc::FakeSystemCommand.stubs_command(['/usr/bin/sudo', '-E', '--', '/usr/bin/osascript', '-e', 'tell application id "my.fancy.package.app" to quit'])
Hbc::FakeSystemCommand.expects_command(['/usr/bin/osascript', '-e', 'tell application "System Events" to delete every login item whose name is "Fancy"'])
Hbc::FakeSystemCommand.expects_command(['/usr/bin/sudo', '-E', '--', @cask.staged_path.join('MyFancyPkg','FancyUninstaller.tool'), '--please'])
Hbc::FakeSystemCommand.expects_command(['/usr/bin/sudo', '-E', '--', '/bin/rm', '-rf', '--',
Pathname.new('~/Library/Preferences/my.fancy.app.plist').expand_path])

View File

@ -12,5 +12,6 @@ cask :v1test => 'with-zap' do
:args => %w[--please]
},
:quit => 'my.fancy.package.app',
:login_item => 'Fancy',
:delete => '~/Library/Preferences/my.fancy.app.plist'
end