diff options
| author | Markus Reiter | 2016-12-06 16:36:34 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-01-25 13:33:12 +0100 |
| commit | f717831a032c96fa583ab27d7ad2f300ad81b764 (patch) | |
| tree | 9afe1fc60c7395b0eed76c95e65adc20a04d6cae /Library/Homebrew/test/support | |
| parent | 35045b2934d94eabe302693a05b12fb530827454 (diff) | |
| download | brew-f717831a032c96fa583ab27d7ad2f300ad81b764.tar.bz2 | |
Move Cask fixtures to `test/support/fixtures`.
Diffstat (limited to 'Library/Homebrew/test/support')
132 files changed, 1322 insertions, 0 deletions
diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-checkpoint-sha256-for-empty-string.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-checkpoint-sha256-for-empty-string.rb new file mode 100644 index 000000000..f40f244f2 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-checkpoint-sha256-for-empty-string.rb @@ -0,0 +1,4 @@ +test_cask 'appcast-checkpoint-sha256-for-empty-string' do + appcast 'http://localhost/appcast.xml', + checkpoint: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-invalid-checkpoint.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-invalid-checkpoint.rb new file mode 100644 index 000000000..e182c2389 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-invalid-checkpoint.rb @@ -0,0 +1,4 @@ +test_cask 'appcast-invalid-checkpoint' do + appcast 'http://localhost/appcast.xml', + checkpoint: 'not a valid shasum' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-missing-checkpoint.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-missing-checkpoint.rb new file mode 100644 index 000000000..5ab2c0665 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-missing-checkpoint.rb @@ -0,0 +1,3 @@ +test_cask 'appcast-missing-checkpoint' do + appcast 'http://localhost/appcast.xml' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-valid-checkpoint.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-valid-checkpoint.rb new file mode 100644 index 000000000..96d7edbba --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/appcast-valid-checkpoint.rb @@ -0,0 +1,4 @@ +test_cask 'appcast-valid-checkpoint' do + appcast 'http://localhost/appcast.xml', + checkpoint: 'd5b2dfbef7ea28c25f7a77cd7fa14d013d82b626db1d82e00e25822464ba19e2' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/appdir-interpolation.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/appdir-interpolation.rb new file mode 100644 index 000000000..fdc09ef5a --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/appdir-interpolation.rb @@ -0,0 +1,9 @@ +test_cask 'appdir-interpolation' do + version '2.61' + sha256 'e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68' + + url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.dmg" + homepage 'http://example.com/appdir-interpolation' + + binary "#{appdir}/some/path" +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/auto-updates.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/auto-updates.rb new file mode 100644 index 000000000..0fcdb991a --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/auto-updates.rb @@ -0,0 +1,11 @@ +test_cask 'auto-updates' do + version '2.61' + sha256 'e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68' + + url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.dmg" + homepage 'http://example.com/auto-updates' + + auto_updates true + + app 'Transmission.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/bad-checksum.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/bad-checksum.rb new file mode 100644 index 000000000..79e5f24c9 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/bad-checksum.rb @@ -0,0 +1,9 @@ +test_cask 'bad-checksum' do + version '1.2.3' + sha256 'badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/basic-cask.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/basic-cask.rb new file mode 100644 index 000000000..d3aaa283e --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/basic-cask.rb @@ -0,0 +1,9 @@ +test_cask 'basic-cask' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url 'http://example.com/TestCask.dmg' + homepage 'http://example.com/' + + app 'TestCask.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/booby-trap.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/booby-trap.rb new file mode 100644 index 000000000..21bd97952 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/booby-trap.rb @@ -0,0 +1,8 @@ +cask 'booby-trap' do + version '0.0.7' + + url do + # to be lazily evaluated + fail 'Boom' + end +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-7z.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-7z.rb new file mode 100644 index 000000000..7dd01eee4 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-7z.rb @@ -0,0 +1,11 @@ +test_cask 'container-7z' do + version '1.2.3' + sha256 '3f9542ace85ed5f88549e2d0ea82210f8ddc87e0defbb78469d3aed719b3c964' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.7z" + homepage 'https://example.com/container-7z' + + depends_on formula: 'unar' + + app 'container' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-air.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-air.rb new file mode 100644 index 000000000..c310e0a6f --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-air.rb @@ -0,0 +1,9 @@ +test_cask 'container-air' do + version '0.1' + sha256 '554472e163f8a028629b12b468e29acda9f16b223dff74fcd218bba73cc2365a' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.air" + homepage 'https://example.com/container-air' + + app 'container.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-bzip2.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-bzip2.rb new file mode 100644 index 000000000..9d9bdff98 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-bzip2.rb @@ -0,0 +1,9 @@ +test_cask 'container-bzip2' do + version '1.2.3' + sha256 'eaf67b3a62cb9275f96e45d05c70b94bef9ef1dae344083e93eda6b0b388a61c' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.bz2" + homepage 'https://example.com/container-bzip2' + + app 'container-bzip2--1.2.3' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-cab.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-cab.rb new file mode 100644 index 000000000..ebc7a544e --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-cab.rb @@ -0,0 +1,11 @@ +test_cask 'container-cab' do + version '1.2.3' + sha256 'c267f5cebb14814c8e612a8b7d2bda02aec913f869509b6f1d3883427c0f552b' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.cab" + homepage 'https://example.com/container-cab' + + depends_on formula: 'cabextract' + + app 'container' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-dmg.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-dmg.rb new file mode 100644 index 000000000..d63596f42 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-dmg.rb @@ -0,0 +1,9 @@ +test_cask 'container-dmg' do + version '1.2.3' + sha256 '74d89d4fa5cef175cf43666ce11fefa3741aa1522114042ac75e656be37141a1' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.dmg" + homepage 'https://example.com/container-dmg' + + app 'container' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-gzip.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-gzip.rb new file mode 100644 index 000000000..c2ab00384 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-gzip.rb @@ -0,0 +1,9 @@ +test_cask 'container-gzip' do + version '1.2.3' + sha256 'fa4ebb5246583c4b6e62e1df4e3b71b4e38a1d7d91c025665827195d36214b20' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.gz" + homepage 'https://example.com/container-gzip' + + app 'container' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-lzma.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-lzma.rb new file mode 100644 index 000000000..d5f708523 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-lzma.rb @@ -0,0 +1,11 @@ +test_cask 'container-lzma' do + version '1.2.3' + sha256 '9d7edb32d02ab9bd9749a5bde8756595ea4cfcb1da02ca11c30fb591d4c1ed85' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.lzma" + homepage 'https://example.com/container-lzma' + + depends_on formula: 'lzma' + + app 'container-lzma--1.2.3' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-pkg.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-pkg.rb new file mode 100644 index 000000000..959caaa08 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-pkg.rb @@ -0,0 +1,7 @@ +test_cask 'container-pkg' do + version '1.2.3' + sha256 '611c50c8a2a2098951d2cd0fd54787ed81b92cd97b4b08bd7cba17f1e1d8e40b' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.pkg" + homepage 'https://example.com/container-pkg' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-rar.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-rar.rb new file mode 100644 index 000000000..7186577a2 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-rar.rb @@ -0,0 +1,11 @@ +test_cask 'container-rar' do + version '1.2.3' + sha256 '419af7864c0e1f125515c49b08bd22e0f7de39f5285897c440fe03c714871763' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.rar" + homepage 'https://example.com/container-rar' + + depends_on formula: 'unar' + + app 'container' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-sit.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-sit.rb new file mode 100644 index 000000000..3a0faad97 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-sit.rb @@ -0,0 +1,11 @@ +test_cask 'container-sit' do + version '1.2.3' + sha256 '0d21a64dce625044345c8ecca888e5439feaf254dac7f884917028a744f93cf3' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.sit" + homepage 'https://example.com/container-sit' + + depends_on formula: 'unar' + + app 'container' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-tar-gz.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-tar-gz.rb new file mode 100644 index 000000000..58e1d82fd --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-tar-gz.rb @@ -0,0 +1,9 @@ +test_cask 'container-tar-gz' do + version '1.2.3' + sha256 'fab685fabf73d5a9382581ce8698fce9408f5feaa49fa10d9bc6c510493300f5' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.tar.gz" + homepage 'https://example.com/container-tar-gz' + + app 'container' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-xar.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-xar.rb new file mode 100644 index 000000000..35e01d0a8 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-xar.rb @@ -0,0 +1,9 @@ +test_cask 'container-xar' do + version '1.2.3' + sha256 '5bb8e09a6fc630ebeaf266b1fd2d15e2ae7d32d7e4da6668a8093426fa1ba509' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.xar" + homepage 'https://example.com/container-xar' + + app 'container' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/container-xz.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/container-xz.rb new file mode 100644 index 000000000..b27e908ae --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/container-xz.rb @@ -0,0 +1,11 @@ +test_cask 'container-xz' do + version '1.2.3' + sha256 '839263f474edde1d54a9101606e6f0dc9d963acc93f6dcc5af8d10ebc3187c02' + + url "file://#{TEST_FIXTURE_DIR}/cask/container.xz" + homepage 'https://example.com/container-xz' + + depends_on formula: 'xz' + + app 'container-xz--1.2.3' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/generic-artifact-absolute-target.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/generic-artifact-absolute-target.rb new file mode 100644 index 000000000..475fb055f --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/generic-artifact-absolute-target.rb @@ -0,0 +1,3 @@ +test_cask 'generic-artifact-absolute-target' do + artifact 'Caffeine.app', target: "#{Hbc.appdir}/Caffeine.app" +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/generic-artifact-no-target.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/generic-artifact-no-target.rb new file mode 100644 index 000000000..f7657dbb5 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/generic-artifact-no-target.rb @@ -0,0 +1,3 @@ +test_cask 'generic-artifact-no-target' do + artifact 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/generic-artifact-relative-target.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/generic-artifact-relative-target.rb new file mode 100644 index 000000000..f97441751 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/generic-artifact-relative-target.rb @@ -0,0 +1,3 @@ +test_cask 'generic-artifact-relative-target' do + artifact 'Caffeine.app', target: 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid-sha256.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid-sha256.rb new file mode 100644 index 000000000..aac00f495 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid-sha256.rb @@ -0,0 +1,4 @@ +test_cask 'invalid-sha256' do + version '1.2.3' + sha256 'not a valid shasum' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-appcast-multiple.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-appcast-multiple.rb new file mode 100644 index 000000000..db2621074 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-appcast-multiple.rb @@ -0,0 +1,13 @@ +test_cask 'invalid-appcast-multiple' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + appcast 'http://example.com/appcast1.xml', + checkpoint: '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + appcast 'http://example.com/appcast2.xml', + checkpoint: '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + homepage 'http://example.com/invalid-appcast-multiple' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-appcast-url.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-appcast-url.rb new file mode 100644 index 000000000..b4c11b1be --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-appcast-url.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-appcast-url' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + appcast 1, + checkpoint: '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + homepage 'http://example.com/invalid-appcast-url' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-conflicts-with-key.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-conflicts-with-key.rb new file mode 100644 index 000000000..d39d124b0 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-conflicts-with-key.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-conflicts-with-key' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-conflicts-with-key' + + conflicts_with no_such_key: 'unar' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-arch-value.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-arch-value.rb new file mode 100644 index 000000000..b0c919a9b --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-arch-value.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-depends-on-arch-value' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-depends-on-arch-value' + + depends_on arch: :no_such_arch + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-key.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-key.rb new file mode 100644 index 000000000..05304e806 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-key.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-depends-on-key' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-depends-on-key' + + depends_on no_such_key: 'unar' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-bad-release.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-bad-release.rb new file mode 100644 index 000000000..183dd5d91 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-bad-release.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-depends-on-macos-bad-release' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-depends-on-macos-bad-release' + + depends_on macos: :no_such_release + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-conflicting-forms.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-conflicting-forms.rb new file mode 100644 index 000000000..b1f763d76 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-macos-conflicting-forms.rb @@ -0,0 +1,12 @@ +test_cask 'invalid-depends-on-macos-conflicting-forms' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-depends-on-macos-conflicting-forms' + + depends_on macos: :yosemite + depends_on macos: '>= :mavericks' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-x11-value.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-x11-value.rb new file mode 100644 index 000000000..eefd3ac40 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-depends-on-x11-value.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-depends-on-x11-value' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-depends-on-x11-value' + + depends_on x11: :no_such_value + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-conflicting-keys.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-conflicting-keys.rb new file mode 100644 index 000000000..bf14d372b --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-conflicting-keys.rb @@ -0,0 +1,12 @@ +test_cask 'invalid-gpg-conflicting-keys' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-gpg-conflicting-keys' + gpg 'http://example.com/gpg-signature.asc', + key_id: '01234567', + key_url: 'http://example.com/gpg-key-url' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-key-id.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-key-id.rb new file mode 100644 index 000000000..626e02a47 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-key-id.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-gpg-key-id' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-gpg-key-id' + gpg 'http://example.com/gpg-signature.asc', + key_id: '012' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-key-url.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-key-url.rb new file mode 100644 index 000000000..77d41ed6b --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-key-url.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-gpg-key-url' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-gpg-key-url' + gpg 'http://example.com/gpg-signature.asc', + key_url: 1 + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-missing-key.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-missing-key.rb new file mode 100644 index 000000000..460bcd532 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-missing-key.rb @@ -0,0 +1,10 @@ +test_cask 'invalid-gpg-missing-key' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-gpg-missing-keys' + gpg 'http://example.com/gpg-signature.asc' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-multiple-stanzas.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-multiple-stanzas.rb new file mode 100644 index 000000000..8abc89486 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-multiple-stanzas.rb @@ -0,0 +1,13 @@ +test_cask 'invalid-gpg-multiple-stanzas' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-gpg-multiple-stanzas' + gpg 'http://example.com/gpg-signature.asc', + key_id: '01234567' + gpg 'http://example.com/gpg-signature.asc', + key_id: '01234567' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-parameter.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-parameter.rb new file mode 100644 index 000000000..f1abc9225 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-parameter.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-gpg-parameter' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-gpg-type' + gpg 'http://example.com/gpg-signature.asc', + no_such_parameter: :value + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-signature-url.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-signature-url.rb new file mode 100644 index 000000000..1b9e7362f --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-signature-url.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-gpg-signature-url' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-gpg-signature-url' + gpg 1, + key_id: '01234567' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-type.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-type.rb new file mode 100644 index 000000000..266047617 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-gpg-type.rb @@ -0,0 +1,11 @@ +test_cask 'invalid-gpg-type' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/invalid-gpg-type' + gpg 'http://example.com/gpg-signature.asc', + no_such_parameter: :value + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-format.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-format.rb new file mode 100644 index 000000000..a8159c979 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-format.rb @@ -0,0 +1,9 @@ +test_cask => 'invalid-header-format' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-token-mismatch.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-token-mismatch.rb new file mode 100644 index 000000000..2b8ad5619 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-token-mismatch.rb @@ -0,0 +1,9 @@ +test_cask 'invalid-header-token-mismatch-this-text-does-not-belong' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-version.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-version.rb new file mode 100644 index 000000000..47851c0e0 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-header-version.rb @@ -0,0 +1,9 @@ +test_cask 'invalid-header-version' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-stage-only-conflict.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-stage-only-conflict.rb new file mode 100644 index 000000000..84510ac24 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-stage-only-conflict.rb @@ -0,0 +1,10 @@ +test_cask 'invalid-stage-only-conflict' do + version '2.61' + sha256 'e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68' + + url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.dmg" + homepage 'http://example.com/invalid-stage-only-conflict' + + app 'Transmission.app' + stage_only true +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-homepage.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-homepage.rb new file mode 100644 index 000000000..d4e5ff4a9 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-homepage.rb @@ -0,0 +1,10 @@ +test_cask 'invalid-two-homepage' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + homepage 'http://www.example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-url.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-url.rb new file mode 100644 index 000000000..49e470788 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-url.rb @@ -0,0 +1,10 @@ +test_cask 'invalid-two-url' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + url 'http://example.com/caffeine.zip' + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-version.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-version.rb new file mode 100644 index 000000000..c9fe37772 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/invalid/invalid-two-version.rb @@ -0,0 +1,10 @@ +test_cask 'invalid-two-version' do + version '1.2.3' + version '2.0' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/local-caffeine.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/local-caffeine.rb new file mode 100644 index 000000000..2be9b4397 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/local-caffeine.rb @@ -0,0 +1,9 @@ +test_cask 'local-caffeine' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/local-transmission.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/local-transmission.rb new file mode 100644 index 000000000..f5244d0a5 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/local-transmission.rb @@ -0,0 +1,9 @@ +test_cask 'local-transmission' do + version '2.61' + sha256 'e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68' + + url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.dmg" + homepage 'http://example.com/local-transmission' + + app 'Transmission.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/missing-checksum.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-checksum.rb new file mode 100644 index 000000000..5e1886a57 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-checksum.rb @@ -0,0 +1,8 @@ +test_cask 'missing-checksum' do + version '1.2.3' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/missing-homepage.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-homepage.rb new file mode 100644 index 000000000..ff924541d --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-homepage.rb @@ -0,0 +1,5 @@ +test_cask 'missing-homepage' do + version '1.2.3' + + url 'http://localhost/something.dmg' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/missing-name.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-name.rb new file mode 100644 index 000000000..a5265b379 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-name.rb @@ -0,0 +1,5 @@ +test_cask 'missing-name' do + version '1.2.3' + + url 'http://localhost/something.dmg' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/missing-sha256.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-sha256.rb new file mode 100644 index 000000000..7f8027907 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-sha256.rb @@ -0,0 +1,5 @@ +test_cask 'missing-sha256' do + version '1.2.3' + + url 'http://localhost/something.dmg' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/missing-url.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-url.rb new file mode 100644 index 000000000..1b3e76b9c --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-url.rb @@ -0,0 +1,5 @@ +test_cask 'missing-url' do + version '1.2.3' + + homepage 'http://example.com' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/missing-version.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-version.rb new file mode 100644 index 000000000..da2160bce --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/missing-version.rb @@ -0,0 +1,4 @@ +test_cask 'missing-version' do + url 'http://localhost/something.dmg' + homepage 'http://example.com' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/naked-executable.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/naked-executable.rb new file mode 100644 index 000000000..619c7a5fb --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/naked-executable.rb @@ -0,0 +1,9 @@ +test_cask 'naked-executable' do + version '1.2.3' + sha256 '306c6ca7407560340797866e077e053627ad409277d1b9da58106fce4cf717cb' + + url "file://#{TEST_FIXTURE_DIR}/cask/naked_executable" + homepage 'http://example.com/naked-executable' + + container type: :naked +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/nested-app.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/nested-app.rb new file mode 100644 index 000000000..526c7414a --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/nested-app.rb @@ -0,0 +1,11 @@ +test_cask 'nested-app' do + version '1.2.3' + sha256 '1866dfa833b123bb8fe7fa7185ebf24d28d300d0643d75798bc23730af734216' + + url "file://#{TEST_FIXTURE_DIR}/cask/NestedApp.dmg.zip" + homepage 'http://example.com/nested-app' + + container nested: 'NestedApp.dmg' + + app 'MyNestedApp.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/no-checksum.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/no-checksum.rb new file mode 100644 index 000000000..d9ba354f5 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/no-checksum.rb @@ -0,0 +1,9 @@ +test_cask 'no-checksum' do + version '1.2.3' + sha256 :no_check + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/no-dsl-version.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/no-dsl-version.rb new file mode 100644 index 000000000..ee557b1e4 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/no-dsl-version.rb @@ -0,0 +1,9 @@ +test_cask 'no-dsl-version' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url 'http://example.com/TestCask.dmg' + homepage 'http://example.com/' + + app 'TestCask.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/osdn-correct-url-format.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/osdn-correct-url-format.rb new file mode 100644 index 000000000..da6ff0fcd --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/osdn-correct-url-format.rb @@ -0,0 +1,6 @@ +test_cask 'osdn-correct-url-format' do + version '1.2.3' + + url 'http://user.dl.osdn.jp/something/id/Something-1.2.3.dmg' + homepage 'http://osdn.jp/projects/something/' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/osdn-incorrect-url-format.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/osdn-incorrect-url-format.rb new file mode 100644 index 000000000..8400159a1 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/osdn-incorrect-url-format.rb @@ -0,0 +1,6 @@ +test_cask 'osdn-incorrect-url-format' do + version '1.2.3' + + url 'http://osdn.jp/projects/something/files/Something-1.2.3.dmg/download' + homepage 'http://osdn.jp/projects/something/' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/sha256-for-empty-string.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/sha256-for-empty-string.rb new file mode 100644 index 000000000..b97764071 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/sha256-for-empty-string.rb @@ -0,0 +1,4 @@ +test_cask 'sha256-for-empty-string' do + version '1.2.3' + sha256 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/sourceforge-correct-url-format.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/sourceforge-correct-url-format.rb new file mode 100644 index 000000000..41ef73500 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/sourceforge-correct-url-format.rb @@ -0,0 +1,6 @@ +test_cask 'sourceforge-correct-url-format' do + version '1.2.3' + + url 'https://downloads.sourceforge.net/something/Something-1.2.3.dmg' + homepage 'https://sourceforge.net/projects/something/' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/sourceforge-incorrect-url-format.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/sourceforge-incorrect-url-format.rb new file mode 100644 index 000000000..27b5490b7 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/sourceforge-incorrect-url-format.rb @@ -0,0 +1,6 @@ +test_cask 'sourceforge-incorrect-url-format' do + version '1.2.3' + + url 'http://sourceforge.net/projects/something/files/Something-1.2.3.dmg/download' + homepage 'http://sourceforge.net/projects/something/' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/sourceforge-version-latest-correct-url-format.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/sourceforge-version-latest-correct-url-format.rb new file mode 100644 index 000000000..d9546c5e1 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/sourceforge-version-latest-correct-url-format.rb @@ -0,0 +1,6 @@ +test_cask 'sourceforge-version-latest-correct-url-format' do + version :latest + + url 'https://sourceforge.net/projects/something/files/latest/download' + homepage 'https://sourceforge.net/projects/something/' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/stage-only.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/stage-only.rb new file mode 100644 index 000000000..b52b5d3d2 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/stage-only.rb @@ -0,0 +1,9 @@ +test_cask 'stage-only' do + version '2.61' + sha256 'e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68' + + url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.dmg" + homepage 'http://example.com/stage-only' + + stage_only true +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/test-opera-mail.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/test-opera-mail.rb new file mode 100644 index 000000000..afc8387c7 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/test-opera-mail.rb @@ -0,0 +1,9 @@ +test_cask 'test-opera-mail' do + version '1.0' + sha256 'afd192e308f8ea8ddb3d426fd6663d97078570417ee78b8e1fa15f515ae3d677' + + url 'http://get-ash-1.opera.com/pub/opera/mail/1.0/mac/Opera-Mail-1.0-1040.i386.dmg' + homepage 'http://www.opera.com/computer/mail' + + app 'Opera Mail.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/test-opera.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/test-opera.rb new file mode 100644 index 000000000..ec32828f7 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/test-opera.rb @@ -0,0 +1,9 @@ +test_cask 'test-opera' do + version '19.0.1326.47' + sha256 '7b91f20ab754f7b3fef8dc346e0393917e11676b74c8f577408841619f76040a' + + url 'http://get.geo.opera.com/pub/opera/desktop/19.0.1326.47/mac/Opera_19.0.1326.47_Setup.dmg' + homepage 'http://www.opera.com/' + + app 'Opera.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/version-latest-string.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/version-latest-string.rb new file mode 100644 index 000000000..3b4723f45 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/version-latest-string.rb @@ -0,0 +1,4 @@ +test_cask 'version-latest-string' do + version 'latest' + sha256 :no_check +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/version-latest-with-checksum.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/version-latest-with-checksum.rb new file mode 100644 index 000000000..884ddff90 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/version-latest-with-checksum.rb @@ -0,0 +1,4 @@ +test_cask 'version-latest-with-checksum' do + version :latest + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-accessibility-access.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-accessibility-access.rb new file mode 100644 index 000000000..1aa7bc8f7 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-accessibility-access.rb @@ -0,0 +1,11 @@ +test_cask 'with-accessibility-access' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url 'http://example.com/TestCask.dmg' + homepage 'http://example.com/' + + accessibility_access true + + app 'TestCask.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-alt-target.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-alt-target.rb new file mode 100644 index 000000000..b75ff320c --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-alt-target.rb @@ -0,0 +1,9 @@ +test_cask 'with-alt-target' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app', target: 'AnotherName.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-appcast.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-appcast.rb new file mode 100644 index 000000000..f99f7a93c --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-appcast.rb @@ -0,0 +1,11 @@ +test_cask 'with-appcast' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + appcast 'http://example.com/appcast.xml', + checkpoint: '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + homepage 'http://example.com/with-appcast' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-binary.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-binary.rb new file mode 100644 index 000000000..d8cede7aa --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-binary.rb @@ -0,0 +1,10 @@ +test_cask 'with-binary' do + version '1.2.3' + sha256 'd5b2dfbef7ea28c25f7a77cd7fa14d013d82b626db1d82e00e25822464ba19e2' + + url "file://#{TEST_FIXTURE_DIR}/cask/AppWithBinary.zip" + homepage 'http://example.com/with-binary' + + app 'App.app' + binary 'binary' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-caveats.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-caveats.rb new file mode 100644 index 000000000..30d3a49b3 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-caveats.rb @@ -0,0 +1,23 @@ +test_cask 'with-caveats' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + 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. + EOS + # do block is evaluated at install-time + caveats do + "Cask token: #{token}" + end + # a do block may print and use a DSL + caveats do + puts 'Custom text via puts followed by DSL-generated text:' + path_environment_variable('/custom/path/bin') + end +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-choices.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-choices.rb new file mode 100644 index 000000000..1871efab3 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-choices.rb @@ -0,0 +1,16 @@ +test_cask 'with-choices' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg', + choices: [ + { + 'choiceIdentifier' => 'choice1', + 'choiceAttribute' => 'selected', + 'attributeSetting' => 1, + }, + ] +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-conditional-caveats.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-conditional-caveats.rb new file mode 100644 index 000000000..d8a3836b8 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-conditional-caveats.rb @@ -0,0 +1,14 @@ +test_cask 'with-conditional-caveats' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + 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 # rubocop:disable Lint/LiteralInCondition + end +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-conflicts-with.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-conflicts-with.rb new file mode 100644 index 000000000..a20d932ba --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-conflicts-with.rb @@ -0,0 +1,11 @@ +test_cask 'with-conflicts-with' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-conflicts-with' + + conflicts_with formula: 'unar' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-arch.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-arch.rb new file mode 100644 index 000000000..e0c4e3fa7 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-arch.rb @@ -0,0 +1,12 @@ +test_cask 'with-depends-on-arch' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-arch' + + # covers all known hardware; always succeeds + depends_on arch: :intel + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-cyclic-helper.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-cyclic-helper.rb new file mode 100644 index 000000000..327fc4000 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-cyclic-helper.rb @@ -0,0 +1,11 @@ +test_cask 'with-depends-on-cask-cyclic-helper' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-cask-cyclic-helper' + + depends_on cask: 'with-depends-on-cask-cyclic' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-cyclic.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-cyclic.rb new file mode 100644 index 000000000..f74d860bf --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-cyclic.rb @@ -0,0 +1,12 @@ +test_cask 'with-depends-on-cask-cyclic' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-cask-cyclic' + + depends_on cask: 'local-caffeine' + depends_on cask: 'with-depends-on-cask-cyclic-helper' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-multiple.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-multiple.rb new file mode 100644 index 000000000..bb69b7506 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask-multiple.rb @@ -0,0 +1,12 @@ +test_cask 'with-depends-on-cask-multiple' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-cask-multiple' + + depends_on cask: 'local-caffeine' + depends_on cask: 'local-transmission' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask.rb new file mode 100644 index 000000000..05a180560 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-cask.rb @@ -0,0 +1,11 @@ +test_cask 'with-depends-on-cask' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-cask' + + depends_on cask: 'local-transmission' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-formula-multiple.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-formula-multiple.rb new file mode 100644 index 000000000..c99d2dee1 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-formula-multiple.rb @@ -0,0 +1,12 @@ +test_cask 'with-depends-on-formula-multiple' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-formula-multiple' + + depends_on formula: 'unar' + depends_on formula: 'fileutils' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-formula.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-formula.rb new file mode 100644 index 000000000..b0339e68c --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-formula.rb @@ -0,0 +1,11 @@ +test_cask 'with-depends-on-formula' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-formula' + + depends_on formula: 'unar' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-array.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-array.rb new file mode 100644 index 000000000..cae16704c --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-array.rb @@ -0,0 +1,12 @@ +test_cask 'with-depends-on-macos-array' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-macos-array' + + # since all OS releases are included, this should always pass + depends_on macos: ['10.4', '10.5', '10.6', '10.7', '10.8', '10.9', '10.10', MacOS.version.to_s] + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-comparison.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-comparison.rb new file mode 100644 index 000000000..7f14dd84f --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-comparison.rb @@ -0,0 +1,11 @@ +test_cask 'with-depends-on-macos-comparison' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-macos-comparison' + + depends_on macos: '>= 10.4' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb new file mode 100644 index 000000000..ecefff362 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb @@ -0,0 +1,12 @@ +test_cask 'with-depends-on-macos-failure' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-macos-failure' + + # guarantee a mismatched release + depends_on macos: MacOS.version.to_s == '10.4' ? '10.5' : '10.4' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-string.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-string.rb new file mode 100644 index 000000000..6e370d46a --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-string.rb @@ -0,0 +1,11 @@ +test_cask 'with-depends-on-macos-string' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-macos-string' + + depends_on macos: MacOS.version.to_s + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-symbol.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-symbol.rb new file mode 100644 index 000000000..7f11b6e64 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-symbol.rb @@ -0,0 +1,11 @@ +test_cask 'with-depends-on-macos-symbol' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-macos-symbol' + + depends_on macos: MacOS.version.to_sym + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-x11-false.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-x11-false.rb new file mode 100644 index 000000000..fc84f2daa --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-x11-false.rb @@ -0,0 +1,11 @@ +test_cask 'with-depends-on-x11-false' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-x11-false' + + depends_on x11: false + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-x11.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-x11.rb new file mode 100644 index 000000000..b1a7bad2b --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-x11.rb @@ -0,0 +1,11 @@ +test_cask 'with-depends-on-x11' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-depends-on-x11' + + depends_on x11: true + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-dsl-version.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-dsl-version.rb new file mode 100644 index 000000000..c16343c4b --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-dsl-version.rb @@ -0,0 +1,9 @@ +test_cask :v1 => 'with-dsl-version' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url 'http://example.com/TestCask.dmg' + homepage 'http://example.com/' + + app 'TestCask.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-embedded-binary.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-embedded-binary.rb new file mode 100644 index 000000000..107c6cbe2 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-embedded-binary.rb @@ -0,0 +1,10 @@ +test_cask 'with-embedded-binary' do + version '1.2.3' + sha256 'fe052d3e77d92676775fd916ddb8942e72a565b844ea7f6d055474c99bb4e47b' + + url "file://#{TEST_FIXTURE_DIR}/cask/AppWithEmbeddedBinary.zip" + homepage 'http://example.com/with-binary' + + app 'App.app' + binary "#{appdir}/App.app/Contents/MacOS/App/binary" +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-generic-artifact-no-target.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-generic-artifact-no-target.rb new file mode 100644 index 000000000..a7d347fb5 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-generic-artifact-no-target.rb @@ -0,0 +1,9 @@ +test_cask 'with-generic-artifact-no-target' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-generic-artifact' + + artifact 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-generic-artifact.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-generic-artifact.rb new file mode 100644 index 000000000..e718b994b --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-generic-artifact.rb @@ -0,0 +1,9 @@ +test_cask 'with-generic-artifact' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-generic-artifact' + + artifact 'Caffeine.app', target: "#{Hbc.appdir}/Caffeine.app" +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-gpg-key-url.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-gpg-key-url.rb new file mode 100644 index 000000000..6aa735e1f --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-gpg-key-url.rb @@ -0,0 +1,11 @@ +test_cask 'with-gpg-key-url' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + 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 diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-gpg.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-gpg.rb new file mode 100644 index 000000000..1f7042515 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-gpg.rb @@ -0,0 +1,11 @@ +test_cask 'with-gpg' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-gpg' + gpg 'http://example.com/gpg-signature.asc', + key_id: '01234567' + + app 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-installable.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-installable.rb new file mode 100644 index 000000000..d1105b50e --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-installable.rb @@ -0,0 +1,20 @@ +test_cask 'with-installable' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + 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', + ], + rmdir: "#{TEST_FIXTURE_DIR}/cask/empty_directory" +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-installer-manual.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-installer-manual.rb new file mode 100644 index 000000000..92e2e09df --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-installer-manual.rb @@ -0,0 +1,9 @@ +test_cask 'with-installer-manual' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + installer manual: 'Caffeine.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-installer-script.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-installer-script.rb new file mode 100644 index 000000000..5e98eab48 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-installer-script.rb @@ -0,0 +1,15 @@ +test_cask 'with-installer-script' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/with-install-script' + + installer script: '/usr/bin/true', + args: ['--flag'] + # acceptable alternate form + installer script: { + executable: '/usr/bin/false', + args: ['--flag'], + } +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-macosx-dir.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-macosx-dir.rb new file mode 100644 index 000000000..837627119 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-macosx-dir.rb @@ -0,0 +1,9 @@ +test_cask 'with-macosx-dir' do + version '1.2.3' + sha256 '5633c3a0f2e572cbf021507dec78c50998b398c343232bdfc7e26221d0a5db4d' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyApp.zip" + homepage 'http://example.com/MyFancyApp' + + app 'MyFancyApp/MyFancyApp.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-pkgutil-zap.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-pkgutil-zap.rb new file mode 100644 index 000000000..8bb42c447 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-pkgutil-zap.rb @@ -0,0 +1,13 @@ +test_cask 'with-pkgutil-zap' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'Fancy.pkg' + + zap pkgutil: 'my.fancy.package.*', + kext: 'my.fancy.package.kernelextension', + launchctl: 'my.fancy.package.service' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-suite.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-suite.rb new file mode 100644 index 000000000..c36151d52 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-suite.rb @@ -0,0 +1,10 @@ +test_cask 'with-suite' do + version '1.2.3' + sha256 'd95dcc12d4e5be0bc3cb9793c4b7e7f69a25f0b3c7418494b0c883957e6eeae4' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine-suite.zip" + name 'Caffeine' + homepage 'http://example.com/with-suite' + + suite 'Caffeine' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-correct.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-correct.rb new file mode 100644 index 000000000..8eb68d88a --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-correct.rb @@ -0,0 +1,10 @@ +test_cask 'with-two-apps-correct' do + version '1.2.3' + sha256 '3178fbfd1ea5d87a2a0662a4eb599ebc9a03888e73f37538d9f3f6ee69d2368e' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeines.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine Mini.app' + app 'Caffeine Pro.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-incorrect.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-incorrect.rb new file mode 100644 index 000000000..6bd316dfe --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-incorrect.rb @@ -0,0 +1,9 @@ +test_cask 'with-two-apps-incorrect' do + version '1.2.3' + sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeine.app', 'Caffeine.app/Contents/MacOS/Caffeine' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-subdir.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-subdir.rb new file mode 100644 index 000000000..202423691 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-two-apps-subdir.rb @@ -0,0 +1,10 @@ +test_cask 'with-two-apps-subdir' do + version '1.2.3' + sha256 'd687c22a21c02bd8f07da9302c8292b93a04df9a929e3f04d09aea6c76f75c65' + + url "file://#{TEST_FIXTURE_DIR}/cask/caffeines-subdir.zip" + homepage 'http://example.com/local-caffeine' + + app 'Caffeines/Caffeine Mini.app' + app 'Caffeines/Caffeine Pro.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-delete.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-delete.rb new file mode 100644 index 000000000..203f18405 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-delete.rb @@ -0,0 +1,16 @@ +test_cask 'with-uninstall-delete' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'Fancy.pkg' + + uninstall delete: [ + '/permissible/absolute/path', + '~/permissible/path/with/tilde', + 'impermissible/relative/path', + '/another/impermissible/../relative/path', + ] +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-early-script.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-early-script.rb new file mode 100644 index 000000000..a26abab1c --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-early-script.rb @@ -0,0 +1,11 @@ +test_cask 'with-uninstall-early-script' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + uninstall early_script: { executable: 'MyFancyPkg/FancyUninstaller.tool', args: %w[--please] } +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-kext.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-kext.rb new file mode 100644 index 000000000..fa54c7e1f --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-kext.rb @@ -0,0 +1,11 @@ +test_cask 'with-uninstall-kext' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'Fancy.pkg' + + uninstall kext: 'my.fancy.package.kernelextension' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-launchctl.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-launchctl.rb new file mode 100644 index 000000000..51ad45a09 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-launchctl.rb @@ -0,0 +1,11 @@ +test_cask 'with-uninstall-launchctl' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyApp.zip" + homepage 'http://example.com/fancy' + + app 'Fancy.app' + + uninstall launchctl: 'my.fancy.package.service' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-login-item.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-login-item.rb new file mode 100644 index 000000000..26dca6f1a --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-login-item.rb @@ -0,0 +1,11 @@ +test_cask 'with-uninstall-login-item' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + uninstall login_item: 'Fancy' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-pkgutil.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-pkgutil.rb new file mode 100644 index 000000000..db77a460b --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-pkgutil.rb @@ -0,0 +1,11 @@ +test_cask 'with-uninstall-pkgutil' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'Fancy.pkg' + + uninstall pkgutil: 'my.fancy.package.*' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-quit.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-quit.rb new file mode 100644 index 000000000..19337b18a --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-quit.rb @@ -0,0 +1,11 @@ +test_cask 'with-uninstall-quit' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + uninstall quit: 'my.fancy.package.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-rmdir.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-rmdir.rb new file mode 100644 index 000000000..88142ea71 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-rmdir.rb @@ -0,0 +1,11 @@ +test_cask 'with-uninstall-rmdir' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + uninstall rmdir: "#{TEST_FIXTURE_DIR}/cask/empty_directory" +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script.rb new file mode 100644 index 000000000..d2e0d6167 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script.rb @@ -0,0 +1,11 @@ +test_cask 'with-uninstall-script' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + uninstall script: { executable: 'MyFancyPkg/FancyUninstaller.tool', args: %w[--please] } +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-signal.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-signal.rb new file mode 100644 index 000000000..cc32b888a --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-signal.rb @@ -0,0 +1,14 @@ +test_cask 'with-uninstall-signal' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + uninstall signal: [ + ['TERM', 'my.fancy.package.app'], + ['KILL', 'my.fancy.package.app'], + ] +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-trash.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-trash.rb new file mode 100644 index 000000000..4fe58a19a --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-trash.rb @@ -0,0 +1,16 @@ +test_cask 'with-uninstall-trash' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'Fancy.pkg' + + uninstall trash: [ + '/permissible/absolute/path', + '~/permissible/path/with/tilde', + 'impermissible/relative/path', + '/another/impermissible/../relative/path', + ] +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-delete.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-delete.rb new file mode 100644 index 000000000..c76a9acb0 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-delete.rb @@ -0,0 +1,16 @@ +test_cask 'with-zap-delete' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'Fancy.pkg' + + zap delete: [ + '/permissible/absolute/path', + '~/permissible/path/with/tilde', + 'impermissible/relative/path', + '/another/impermissible/../relative/path', + ] +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-early-script.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-early-script.rb new file mode 100644 index 000000000..d35c1809e --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-early-script.rb @@ -0,0 +1,11 @@ +test_cask 'with-zap-early-script' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + zap early_script: { executable: 'MyFancyPkg/FancyUninstaller.tool', args: %w[--please] } +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-kext.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-kext.rb new file mode 100644 index 000000000..463fe8133 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-kext.rb @@ -0,0 +1,11 @@ +test_cask 'with-zap-kext' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'Fancy.pkg' + + zap kext: 'my.fancy.package.kernelextension' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-launchctl.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-launchctl.rb new file mode 100644 index 000000000..aab285672 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-launchctl.rb @@ -0,0 +1,11 @@ +test_cask 'with-zap-launchctl' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyApp.zip" + homepage 'http://example.com/fancy' + + app 'Fancy.app' + + zap launchctl: 'my.fancy.package.service' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-login-item.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-login-item.rb new file mode 100644 index 000000000..d7ba9a65b --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-login-item.rb @@ -0,0 +1,11 @@ +test_cask 'with-zap-login-item' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + zap login_item: 'Fancy' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-pkgutil.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-pkgutil.rb new file mode 100644 index 000000000..17a667000 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-pkgutil.rb @@ -0,0 +1,11 @@ +test_cask 'with-zap-pkgutil' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'Fancy.pkg' + + zap pkgutil: 'my.fancy.package.*' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-quit.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-quit.rb new file mode 100644 index 000000000..21f824ae9 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-quit.rb @@ -0,0 +1,11 @@ +test_cask 'with-zap-quit' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + zap quit: 'my.fancy.package.app' +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-rmdir.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-rmdir.rb new file mode 100644 index 000000000..eac02ad0e --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-rmdir.rb @@ -0,0 +1,11 @@ +test_cask 'with-zap-rmdir' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + zap rmdir: "#{TEST_FIXTURE_DIR}/cask/empty_directory" +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-script.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-script.rb new file mode 100644 index 000000000..f8646a267 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-script.rb @@ -0,0 +1,11 @@ +test_cask 'with-zap-script' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + zap script: { executable: 'MyFancyPkg/FancyUninstaller.tool', args: %w[--please] } +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-signal.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-signal.rb new file mode 100644 index 000000000..5accd8337 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-signal.rb @@ -0,0 +1,14 @@ +test_cask 'with-zap-signal' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'MyFancyPkg/Fancy.pkg' + + zap signal: [ + ['TERM', 'my.fancy.package.app'], + ['KILL', 'my.fancy.package.app'], + ] +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-trash.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-trash.rb new file mode 100644 index 000000000..aef4e0eab --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap-trash.rb @@ -0,0 +1,16 @@ +test_cask 'with-zap-trash' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + homepage 'http://example.com/fancy-pkg' + + pkg 'Fancy.pkg' + + zap trash: [ + '/permissible/absolute/path', + '~/permissible/path/with/tilde', + 'impermissible/relative/path', + '/another/impermissible/../relative/path', + ] +end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap.rb new file mode 100644 index 000000000..056c90671 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-zap.rb @@ -0,0 +1,19 @@ +test_cask 'with-zap' do + version '1.2.3' + sha256 '8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b' + + url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyPkg.zip" + 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', + login_item: 'Fancy', + delete: '~/Library/Preferences/my.fancy.app.plist' +end |
