Apply RuboCop to test casks

This commit is contained in:
Josh Hagins 2016-01-03 17:10:10 -05:00
parent ea73e9372d
commit 36e915b826
45 changed files with 85 additions and 54 deletions

View File

@ -1,4 +1,5 @@
test_cask 'missing-homepage' do
url 'http://localhost/something.dmg'
version '1.2.3'
url 'http://localhost/something.dmg'
end

View File

@ -1,4 +1,5 @@
test_cask 'missing-license' do
version '1.2.3'
url 'http://localhost/something.dmg'
end

View File

@ -1,4 +1,5 @@
test_cask 'missing-name' do
version '1.2.3'
url 'http://localhost/something.dmg'
end

View File

@ -1,4 +1,5 @@
test_cask 'missing-sha256' do
version '1.2.3'
url 'http://localhost/something.dmg'
end

View File

@ -1,4 +1,5 @@
test_cask 'missing-url' do
version '1.2.3'
homepage 'http://example.com'
end

View File

@ -1,5 +1,6 @@
test_cask 'osdn-correct-url-format' do
version '1.2.3'
homepage 'http://osdn.jp/projects/something/'
url 'http://user.dl.osdn.jp/something/id/Something-1.2.3.dmg'
homepage 'http://osdn.jp/projects/something/'
end

View File

@ -1,5 +1,6 @@
test_cask 'osdn-incorrect-url-format' do
version '1.2.3'
homepage 'http://osdn.jp/projects/something/'
url 'http://osdn.jp/projects/something/files/Something-1.2.3.dmg/download'
homepage 'http://osdn.jp/projects/something/'
end

View File

@ -1,5 +1,6 @@
test_cask 'sourceforge-correct-url-format' do
version '1.2.3'
homepage 'http://sourceforge.net/projects/something/'
url 'http://downloads.sourceforge.net/project/something/Something-1.2.3.dmg'
homepage 'http://sourceforge.net/projects/something/'
end

View File

@ -1,5 +1,6 @@
test_cask 'sourceforge-incorrect-url-format' do
version '1.2.3'
homepage 'http://sourceforge.net/projects/something/'
url 'http://sourceforge.net/projects/something/files/Something-1.2.3.dmg/download'
homepage 'http://sourceforge.net/projects/something/'
end

View File

@ -1,5 +1,6 @@
test_cask 'sourceforge-version-latest-correct-url-format' do
version :latest
homepage 'http://sourceforge.net/projects/something/'
url 'http://sourceforge.net/projects/something/files/latest/download'
homepage 'http://sourceforge.net/projects/something/'
end

View File

@ -5,7 +5,7 @@ test_cask 'auto-updates' do
url TestHelper.local_binary_url('transmission-2.61.dmg')
homepage 'http://example.com/auto-updates'
app 'Transmission.app'
auto_updates true
app 'Transmission.app'
end

View File

@ -6,5 +6,6 @@ test_cask 'cab-container' do
homepage 'http://example.com/cab-container'
depends_on :formula => 'cabextract'
app 'cabcontainer/Application.app'
end

View File

@ -3,11 +3,11 @@ test_cask 'invalid-appcast-multiple' do
sha256 '9203c30951f9aab41ac294bbeb1dcef7bed401ff0b353dcb34d68af32ea51853'
url TestHelper.local_binary_url('caffeine.zip')
homepage 'http://example.com/invalid-appcast-multiple'
appcast 'http://example.com/appcast1.xml',
:sha256 => '9203c30951f9aab41ac294bbeb1dcef7bed401ff0b353dcb34d68af32ea51853'
appcast 'http://example.com/appcast2.xml',
:sha256 => '9203c30951f9aab41ac294bbeb1dcef7bed401ff0b353dcb34d68af32ea51853'
homepage 'http://example.com/invalid-appcast-multiple'
app 'Caffeine.app'
end

View File

@ -3,9 +3,9 @@ test_cask 'invalid-appcast-url' do
sha256 '9203c30951f9aab41ac294bbeb1dcef7bed401ff0b353dcb34d68af32ea51853'
url TestHelper.local_binary_url('caffeine.zip')
homepage 'http://example.com/invalid-appcast-url'
appcast 1,
:sha256 => '9203c30951f9aab41ac294bbeb1dcef7bed401ff0b353dcb34d68af32ea51853'
homepage 'http://example.com/invalid-appcast-url'
app 'Caffeine.app'
end

View File

@ -5,7 +5,7 @@ test_cask 'invalid-gpg-conflicting-keys' do
url TestHelper.local_binary_url('caffeine.zip')
homepage 'http://example.com/invalid-gpg-conflicting-keys'
gpg 'http://example.com/gpg-signature.asc',
:key_id => '01234567',
:key_id => '01234567',
:key_url => 'http://example.com/gpg-key-url'
app 'Caffeine.app'

View File

@ -5,6 +5,6 @@ test_cask 'invalid-stage-only-conflict' do
url TestHelper.local_binary_url('transmission-2.61.dmg')
homepage 'http://example.com/invalid-stage-only-conflict'
stage_only true
app 'Transmission.app'
stage_only true
end

View File

@ -6,5 +6,6 @@ test_cask 'nested-app' do
homepage 'http://example.com/nested-app'
container :nested => 'NestedApp.dmg'
app 'MyNestedApp.app'
end

View File

@ -6,5 +6,6 @@ test_cask 'rar-container' do
homepage 'http://example.com/rar-container'
depends_on :formula => 'unar'
app 'rarcontainer/Application.app'
end

View File

@ -6,5 +6,6 @@ test_cask 'sevenzip-container' do
homepage 'http://example.com/sevenzip-container'
depends_on :formula => 'unar'
app 'sevenzipcontainer/Application.app'
end

View File

@ -6,5 +6,6 @@ test_cask 'stuffit-container' do
homepage 'http://www.tobias-jung.de/seekingprofont/'
depends_on :formula => 'unar'
artifact 'sheldonmac/v1.0'
end

View File

@ -5,7 +5,7 @@ test_cask 'with-accessibility-access' do
url 'http://example.com/TestCask.dmg'
homepage 'http://example.com/'
app 'TestCask.app'
accessibility_access true
app 'TestCask.app'
end

View File

@ -3,9 +3,9 @@ test_cask 'with-appcast' do
sha256 '9203c30951f9aab41ac294bbeb1dcef7bed401ff0b353dcb34d68af32ea51853'
url TestHelper.local_binary_url('caffeine.zip')
homepage 'http://example.com/with-appcast'
appcast 'http://example.com/appcast.xml',
:sha256 => '9203c30951f9aab41ac294bbeb1dcef7bed401ff0b353dcb34d68af32ea51853'
homepage 'http://example.com/with-appcast'
app 'Caffeine.app'
end

View File

@ -6,6 +6,7 @@ test_cask 'with-caveats' do
homepage 'http://example.com/local-caffeine'
app 'Caffeine.app'
# simple string is evaluated at compile-time
caveats <<-EOS.undent
Here are some things you might want to know.

View File

@ -6,6 +6,7 @@ test_cask 'with-conditional-caveats' do
homepage 'http://example.com/local-caffeine'
app 'Caffeine.app'
# a do block may print and use a DSL
caveats do
puts 'This caveat is conditional' if false

View File

@ -6,5 +6,6 @@ test_cask 'with-conflicts-with' do
homepage 'http://example.com/with-conflicts-with'
conflicts_with :formula => 'unar'
app 'Caffeine.app'
end

View File

@ -6,5 +6,6 @@ test_cask 'with-depends-on-cask' do
homepage 'http://example.com/with-depends-on-cask'
depends_on :cask => 'local-transmission'
app 'Caffeine.app'
end

View File

@ -6,5 +6,6 @@ test_cask 'with-depends-on-formula' do
homepage 'http://example.com/with-depends-on-formula'
depends_on :formula => 'unar'
app 'Caffeine.app'
end

View File

@ -6,7 +6,7 @@ test_cask 'with-depends-on-macos-array' do
homepage 'http://example.com/with-depends-on-macos-array'
# since all OS releases are included, this should always pass
depends_on :macos => [ '10.0', '10.1', '10.2', '10.3', '10.3', '10.5', '10.6', '10.7', '10.8', '10.9', '10.10', MacOS.release.to_s ]
depends_on :macos => ['10.0', '10.1', '10.2', '10.3', '10.3', '10.5', '10.6', '10.7', '10.8', '10.9', '10.10', MacOS.release.to_s]
app 'Caffeine.app'
end

View File

@ -6,5 +6,6 @@ test_cask 'with-gpg-key-url' do
homepage 'http://example.com/with-gpg-key-url'
gpg 'http://example.com/gpg-signature.asc',
:key_url => 'http://example.com/gpg-key-url'
app 'Caffeine.app'
end

View File

@ -6,14 +6,15 @@ test_cask 'with-installable' do
homepage 'http://example.com/fancy-pkg'
pkg 'MyFancyPkg/Fancy.pkg'
uninstall :script => { :executable => 'MyFancyPkg/FancyUninstaller.tool', :args => %w[--please] },
:quit => 'my.fancy.package.app',
:login_item => 'Fancy',
:delete => [
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
],
:rmdir => TestHelper.local_binary_path('empty_directory')
:rmdir => TestHelper.local_binary_path('empty_directory')
end

View File

@ -9,7 +9,7 @@ test_cask 'with-installer-script' do
:args => ['--flag']
# acceptable alternate form
installer :script => {
:executable => '/usr/bin/false',
:args => ['--flag'],
:executable => '/usr/bin/false',
:args => ['--flag'],
}
end

View File

@ -6,7 +6,8 @@ test_cask 'with-pkgutil-zap' do
homepage 'http://example.com/fancy-pkg'
pkg 'Fancy.pkg'
zap :pkgutil => 'my.fancy.package.*',
:kext => 'my.fancy.package.kernelextension',
zap :pkgutil => 'my.fancy.package.*',
:kext => 'my.fancy.package.kernelextension',
:launchctl => 'my.fancy.package.service'
end

View File

@ -8,9 +8,9 @@ test_cask 'with-uninstall-delete' do
pkg 'Fancy.pkg'
uninstall :delete => [
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
]
end

View File

@ -6,5 +6,6 @@ test_cask 'with-uninstall-kext' do
homepage 'http://example.com/fancy-pkg'
pkg 'Fancy.pkg'
uninstall :kext => 'my.fancy.package.kernelextension'
end

View File

@ -6,5 +6,6 @@ test_cask 'with-uninstall-pkgutil' do
homepage 'http://example.com/fancy-pkg'
pkg 'Fancy.pkg'
uninstall :pkgutil => 'my.fancy.package.*'
end

View File

@ -6,5 +6,6 @@ test_cask 'with-uninstall-rmdir' do
homepage 'http://example.com/fancy-pkg'
pkg 'MyFancyPkg/Fancy.pkg'
uninstall :rmdir => TestHelper.local_binary_path('empty_directory')
end

View File

@ -8,7 +8,7 @@ test_cask 'with-uninstall-signal' do
pkg 'MyFancyPkg/Fancy.pkg'
uninstall :signal => [
['TERM', 'my.fancy.package.app'],
['KILL', 'my.fancy.package.app']
['TERM', 'my.fancy.package.app'],
['KILL', 'my.fancy.package.app'],
]
end

View File

@ -8,9 +8,9 @@ test_cask 'with-uninstall-trash' do
pkg 'Fancy.pkg'
uninstall :trash => [
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
]
end

View File

@ -8,9 +8,9 @@ test_cask 'with-zap-delete' do
pkg 'Fancy.pkg'
zap :delete => [
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
]
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
]
end

View File

@ -6,5 +6,6 @@ test_cask 'with-zap-kext' do
homepage 'http://example.com/fancy-pkg'
pkg 'Fancy.pkg'
zap :kext => 'my.fancy.package.kernelextension'
end

View File

@ -6,5 +6,6 @@ test_cask 'with-zap-pkgutil' do
homepage 'http://example.com/fancy-pkg'
pkg 'Fancy.pkg'
zap :pkgutil => 'my.fancy.package.*'
end

View File

@ -6,5 +6,6 @@ test_cask 'with-zap-rmdir' do
homepage 'http://example.com/fancy-pkg'
pkg 'MyFancyPkg/Fancy.pkg'
zap :rmdir => TestHelper.local_binary_path('empty_directory')
end

View File

@ -8,7 +8,7 @@ test_cask 'with-zap-signal' do
pkg 'MyFancyPkg/Fancy.pkg'
zap :signal => [
['TERM', 'my.fancy.package.app'],
['KILL', 'my.fancy.package.app']
]
['TERM', 'my.fancy.package.app'],
['KILL', 'my.fancy.package.app'],
]
end

View File

@ -8,9 +8,9 @@ test_cask 'with-zap-trash' do
pkg 'Fancy.pkg'
zap :trash => [
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
]
'/permissible/absolute/path',
'~/permissible/path/with/tilde',
'impermissible/relative/path',
'/another/impermissible/../relative/path',
]
end

View File

@ -6,12 +6,14 @@ test_cask 'with-zap' do
homepage 'http://example.com/fancy-pkg'
pkg 'MyFancyPkg/Fancy.pkg'
uninstall :quit => 'my.fancy.package.app.from.uninstall'
zap :script => {
:executable => 'MyFancyPkg/FancyUninstaller.tool',
:args => %w[--please]
},
:quit => 'my.fancy.package.app',
zap :script => {
:executable => 'MyFancyPkg/FancyUninstaller.tool',
:args => %w[--please],
},
:quit => 'my.fancy.package.app',
:login_item => 'Fancy',
:delete => '~/Library/Preferences/my.fancy.app.plist'
:delete => '~/Library/Preferences/my.fancy.app.plist'
end