Normalize asset names.

This commit is contained in:
Markus Reiter 2016-08-20 00:03:11 +02:00
parent 7395ff2001
commit 7f2248408c
43 changed files with 232 additions and 223 deletions

View File

@ -16,45 +16,45 @@ describe Hbc::Installer do
end
it "works with dmg-based Casks" do
transmission = Hbc.load("local-transmission")
asset = Hbc.load("container-dmg")
shutup do
Hbc::Installer.new(transmission).install
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("local-transmission", transmission.version)
dest_path = Hbc.caskroom.join("container-dmg", asset.version)
dest_path.must_be :directory?
application = Hbc.appdir.join("Transmission.app")
application.must_be :directory?
file = Hbc.appdir.join("container")
file.must_be :file?
end
it "works with tar-based Casks" do
tarball = Hbc.load("tarball")
it "works with tar-gz-based Casks" do
asset = Hbc.load("container-tar-gz")
shutup do
Hbc::Installer.new(tarball).install
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("tarball", tarball.version)
dest_path = Hbc.caskroom.join("container-tar-gz", asset.version)
dest_path.must_be :directory?
application = Hbc.appdir.join("Tarball.app")
application.must_be :directory?
application = Hbc.appdir.join("container")
application.must_be :file?
end
it "works with cab-based Casks" do
skip("cabextract not installed") unless Hbc.homebrew_prefix.join("bin", "cabextract").exist?
cab_container = Hbc.load("cab-container")
asset = Hbc.load("cab-container")
empty = stub(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
cab_container.stubs(:depends_on).returns(empty)
asset.stubs(:depends_on).returns(empty)
shutup do
Hbc::Installer.new(cab_container).install
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("cab-container", cab_container.version)
dest_path = Hbc.caskroom.join("cab-container", asset.version)
dest_path.must_be :directory?
application = Hbc.appdir.join("Application.app")
application.must_be :directory?
application = Hbc.appdir.join("container")
application.must_be :file?
end
it "works with Adobe AIR-based Casks" do
@ -73,94 +73,7 @@ describe Hbc::Installer do
it "works with 7z-based Casks" do
skip("unar not installed") unless Hbc.homebrew_prefix.join("bin", "unar").exist?
sevenzip_container = Hbc.load("sevenzip-container")
empty = stub(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
sevenzip_container.stubs(:depends_on).returns(empty)
shutup do
Hbc::Installer.new(sevenzip_container).install
end
dest_path = Hbc.caskroom.join("sevenzip-container", sevenzip_container.version)
dest_path.must_be :directory?
application = Hbc.appdir.join("Application.app")
application.must_be :directory?
end
it "works with xar-based Casks" do
xar_container = Hbc.load("xar-container")
shutup do
Hbc::Installer.new(xar_container).install
end
dest_path = Hbc.caskroom.join("xar-container", xar_container.version)
dest_path.must_be :directory?
application = Hbc.appdir.join("Application.app")
application.must_be :directory?
end
it "works with Stuffit-based Casks" do
skip("unar not installed") unless Hbc.homebrew_prefix.join("bin", "unar").exist?
stuffit_container = Hbc.load("stuffit-container")
empty = stub(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
stuffit_container.stubs(:depends_on).returns(empty)
shutup do
Hbc::Installer.new(stuffit_container).install
end
dest_path = Hbc.caskroom.join("stuffit-container", stuffit_container.version)
dest_path.must_be :directory?
application = Hbc.appdir.join("sheldonmac", "v1.0")
application.must_be :directory?
end
it "works with RAR-based Casks" do
skip("unar not installed") unless Hbc.homebrew_prefix.join("bin", "unar").exist?
rar_container = Hbc.load("rar-container")
empty = stub(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
rar_container.stubs(:depends_on).returns(empty)
shutup do
Hbc::Installer.new(rar_container).install
end
dest_path = Hbc.caskroom.join("rar-container", rar_container.version)
dest_path.must_be :directory?
application = Hbc.appdir.join("Application.app")
application.must_be :directory?
end
it "works with bz2-based Casks" do
asset = Hbc.load("bzipped-asset")
shutup do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("bzipped-asset", asset.version)
dest_path.must_be :directory?
file = Hbc.appdir.join("bzipped-asset--#{asset.version}")
file.must_be :file?
end
it "works with pure gz-based Casks" do
asset = Hbc.load("gzipped-asset")
shutup do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("gzipped-asset", asset.version)
dest_path.must_be :directory?
file = Hbc.appdir.join("gzipped-asset--#{asset.version}")
file.must_be :file?
end
it "works with xz-based Casks" do
skip("unxz not installed") unless Hbc.homebrew_prefix.join("bin", "unxz").exist?
asset = Hbc.load("xzipped-asset")
asset = Hbc.load("container-7z")
empty = stub(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
asset.stubs(:depends_on).returns(empty)
@ -168,15 +81,102 @@ describe Hbc::Installer do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("xzipped-asset", asset.version)
dest_path = Hbc.caskroom.join("container-7z", asset.version)
dest_path.must_be :directory?
file = Hbc.appdir.join("xzipped-asset--#{asset.version}")
file = Hbc.appdir.join("container")
file.must_be :file?
end
it "works with xar-based Casks" do
asset = Hbc.load("container-xar")
shutup do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("container-xar", asset.version)
dest_path.must_be :directory?
file = Hbc.appdir.join("container")
file.must_be :file?
end
it "works with Stuffit-based Casks" do
skip("unar not installed") unless Hbc.homebrew_prefix.join("bin", "unar").exist?
asset = Hbc.load("container-sit")
empty = stub(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
asset.stubs(:depends_on).returns(empty)
shutup do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("container-sit", asset.version)
dest_path.must_be :directory?
application = Hbc.appdir.join("container")
application.must_be :file?
end
it "works with RAR-based Casks" do
skip("unar not installed") unless Hbc.homebrew_prefix.join("bin", "unar").exist?
asset = Hbc.load("container-rar")
empty = stub(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
asset.stubs(:depends_on).returns(empty)
shutup do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("container-rar", asset.version)
dest_path.must_be :directory?
application = Hbc.appdir.join("container")
application.must_be :file?
end
it "works with pure bzip2-based Casks" do
asset = Hbc.load("container-bzip2")
shutup do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("container-bzip2", asset.version)
dest_path.must_be :directory?
file = Hbc.appdir.join("container-bzip2--#{asset.version}")
file.must_be :file?
end
it "works with pure gzip-based Casks" do
asset = Hbc.load("container-gzip")
shutup do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("container-gzip", asset.version)
dest_path.must_be :directory?
file = Hbc.appdir.join("container-gzip--#{asset.version}")
file.must_be :file?
end
it "works with pure xz-based Casks" do
skip("unxz not installed") unless Hbc.homebrew_prefix.join("bin", "unxz").exist?
asset = Hbc.load("container-xz")
empty = stub(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
asset.stubs(:depends_on).returns(empty)
shutup do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("container-xz", asset.version)
dest_path.must_be :directory?
file = Hbc.appdir.join("container-xz--#{asset.version}")
file.must_be :file?
end
it "works with lzma-based Casks" do
skip("unlzma not installed") unless Hbc.homebrew_prefix.join("bin", "unlzma").exist?
asset = Hbc.load("lzma-asset")
asset = Hbc.load("container-lzma")
empty = stub(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
asset.stubs(:depends_on).returns(empty)
@ -184,9 +184,9 @@ describe Hbc::Installer do
Hbc::Installer.new(asset).install
end
dest_path = Hbc.caskroom.join("lzma-asset", asset.version)
dest_path = Hbc.caskroom.join("container-lzma", asset.version)
dest_path.must_be :directory?
file = Hbc.appdir.join("lzma-asset--#{asset.version}")
file = Hbc.appdir.join("container-lzma--#{asset.version}")
file.must_be :file?
end
@ -316,15 +316,15 @@ describe Hbc::Installer do
end # wont_raise
end
it "works properly with a direct URL to a pkg" do
naked_pkg = Hbc.load("naked-pkg")
it "works naked-pkg-based Casks" do
naked_pkg = Hbc.load("container-pkg")
shutup do
Hbc::Installer.new(naked_pkg).install
end
dest_path = Hbc.caskroom.join("naked-pkg", naked_pkg.version)
pkg = dest_path.join("Naked.pkg")
dest_path = Hbc.caskroom.join("container-pkg", naked_pkg.version)
pkg = dest_path.join("container.pkg")
pkg.must_be :file?
end

View File

@ -1,9 +0,0 @@
test_cask 'bzipped-asset' do
version '1.2.3'
sha256 'eaf67b3a62cb9275f96e45d05c70b94bef9ef1dae344083e93eda6b0b388a61c'
url TestHelper.local_binary_url('bzipped_asset.bz2')
homepage 'http://example.com/bzipped-asset'
app 'bzipped-asset--1.2.3'
end

View File

@ -1,11 +0,0 @@
test_cask 'cab-container' do
version '1.2.3'
sha256 '192d0cf6b727473f9ba0f55cec793ee2a8f7113c5cfe9d49e05a087436c5efe2'
url TestHelper.local_binary_url('cabcontainer.cab')
homepage 'http://example.com/cab-container'
depends_on formula: 'cabextract'
app 'cabcontainer/Application.app'
end

View File

@ -0,0 +1,11 @@
test_cask 'container-7z' do
version '1.2.3'
sha256 '3f9542ace85ed5f88549e2d0ea82210f8ddc87e0defbb78469d3aed719b3c964'
url TestHelper.local_binary_url('container.7z')
homepage 'https://example.com/container-7z'
depends_on formula: 'unar'
app 'container'
end

View File

@ -0,0 +1,9 @@
test_cask 'container-bzip2' do
version '1.2.3'
sha256 'eaf67b3a62cb9275f96e45d05c70b94bef9ef1dae344083e93eda6b0b388a61c'
url TestHelper.local_binary_url('container.bz2')
homepage 'https://example.com/container-bzip2'
app 'container-bzip2--1.2.3'
end

View File

@ -0,0 +1,11 @@
test_cask 'container-cab' do
version '1.2.3'
sha256 'c267f5cebb14814c8e612a8b7d2bda02aec913f869509b6f1d3883427c0f552b'
url TestHelper.local_binary_url('container.cab')
homepage 'https://example.com/container-cab'
depends_on formula: 'cabextract'
app 'cabcontainer/Application.app'
end

View File

@ -0,0 +1,9 @@
test_cask 'container-dmg' do
version '1.2.3'
sha256 '74d89d4fa5cef175cf43666ce11fefa3741aa1522114042ac75e656be37141a1'
url TestHelper.local_binary_url('container.dmg')
homepage 'https://example.com/container-dmg'
app 'container'
end

View File

@ -0,0 +1,9 @@
test_cask 'container-gzip' do
version '1.2.3'
sha256 'fa4ebb5246583c4b6e62e1df4e3b71b4e38a1d7d91c025665827195d36214b20'
url TestHelper.local_binary_url('container.gz')
homepage 'https://example.com/container-gzip'
app 'container-gzip--1.2.3'
end

View File

@ -0,0 +1,11 @@
test_cask 'container-lzma' do
version '1.2.3'
sha256 '9d7edb32d02ab9bd9749a5bde8756595ea4cfcb1da02ca11c30fb591d4c1ed85'
url TestHelper.local_binary_url('container.lzma')
homepage 'https://example.com/container-lzma'
depends_on formula: 'lzma'
app 'container-lzma--1.2.3'
end

View File

@ -0,0 +1,7 @@
test_cask 'container-pkg' do
version '1.2.3'
sha256 '611c50c8a2a2098951d2cd0fd54787ed81b92cd97b4b08bd7cba17f1e1d8e40b'
url TestHelper.local_binary_url('container.pkg')
homepage 'https://example.com/container-pkg'
end

View File

@ -0,0 +1,11 @@
test_cask 'container-rar' do
version '1.2.3'
sha256 '419af7864c0e1f125515c49b08bd22e0f7de39f5285897c440fe03c714871763'
url TestHelper.local_binary_url('container.rar')
homepage 'https://example.com/container-rar'
depends_on formula: 'unar'
app 'container'
end

View File

@ -0,0 +1,11 @@
test_cask 'container-sit' do
version '1.2.3'
sha256 '0d21a64dce625044345c8ecca888e5439feaf254dac7f884917028a744f93cf3'
url TestHelper.local_binary_url('container.sit')
homepage 'https://example.com/container-sit'
depends_on formula: 'unar'
app 'container'
end

View File

@ -0,0 +1,9 @@
test_cask 'container-tar-gz' do
version '1.2.3'
sha256 'fab685fabf73d5a9382581ce8698fce9408f5feaa49fa10d9bc6c510493300f5'
url TestHelper.local_binary_url('container.tar.gz')
homepage 'https://example.com/container-tar-gz'
app 'container'
end

View File

@ -0,0 +1,9 @@
test_cask 'container-xar' do
version '1.2.3'
sha256 '5bb8e09a6fc630ebeaf266b1fd2d15e2ae7d32d7e4da6668a8093426fa1ba509'
url TestHelper.local_binary_url('container.xar')
homepage 'https://example.com/container-xar'
app 'container'
end

View File

@ -0,0 +1,11 @@
test_cask 'container-xz' do
version '1.2.3'
sha256 '839263f474edde1d54a9101606e6f0dc9d963acc93f6dcc5af8d10ebc3187c02'
url TestHelper.local_binary_url('container.xz')
homepage 'https://example.com/container-xz'
depends_on formula: 'xz'
app 'container-xz--1.2.3'
end

View File

@ -1,9 +0,0 @@
test_cask 'gzipped-asset' do
version '1.2.3'
sha256 '832506ade94b3e41ecdf2162654eb75891a0749803229e82b2e0420fd1b9e8d2'
url TestHelper.local_binary_url('gzipped_asset.gz')
homepage 'http://example.com/gzipped-asset'
app 'gzipped-asset--1.2.3'
end

View File

@ -1,11 +0,0 @@
test_cask 'lzma-asset' do
version '1.2.3'
sha256 '9d7edb32d02ab9bd9749a5bde8756595ea4cfcb1da02ca11c30fb591d4c1ed85'
url TestHelper.local_binary_url('lzma-asset.lzma')
homepage 'http://example.com/xzipped-asset'
depends_on formula: 'lzma'
app 'lzma-asset--1.2.3'
end

View File

@ -1,7 +0,0 @@
test_cask 'naked-pkg' do
version '1.2.3'
sha256 '611c50c8a2a2098951d2cd0fd54787ed81b92cd97b4b08bd7cba17f1e1d8e40b'
url TestHelper.local_binary_url('Naked.pkg')
homepage 'http://example.com/naked-pkg'
end

View File

@ -1,11 +0,0 @@
test_cask 'rar-container' do
version '1.2.3'
sha256 '35fb13fb13e6aefc38b60486627eff6b6b55b2f99f64bf47938530c6cf9e0a0f'
url TestHelper.local_binary_url('rarcontainer.rar')
homepage 'http://example.com/rar-container'
depends_on formula: 'unar'
app 'rarcontainer/Application.app'
end

View File

@ -1,11 +0,0 @@
test_cask 'sevenzip-container' do
version '1.2.3'
sha256 '1550701e7848fcb94f5b0085cca527083a8662ddeb8c0a7bc5af6bd145797cc1'
url TestHelper.local_binary_url('sevenzipcontainer.7z')
homepage 'http://example.com/sevenzip-container'
depends_on formula: 'unar'
app 'sevenzipcontainer/Application.app'
end

View File

@ -1,11 +0,0 @@
test_cask 'stuffit-container' do
version '1.2.3'
sha256 '892b6d49a98c546381d41dec9b0bbc04267ac008d72b99755968d357099993b7'
url TestHelper.local_binary_url('sheldonmac.sit')
homepage 'http://www.tobias-jung.de/seekingprofont/'
depends_on formula: 'unar'
artifact 'sheldonmac/v1.0', target: "#{Hbc.appdir}/sheldonmac/v1.0"
end

View File

@ -1,9 +0,0 @@
test_cask 'tarball' do
version '1.2.3'
sha256 :no_check
url TestHelper.local_binary_url('tarball.tgz')
homepage 'http://example.com/tarball'
app 'Tarball.app'
end

View File

@ -1,9 +0,0 @@
test_cask 'xar-container' do
version '1.2.3'
sha256 '1418752ac49e859f88590db245015cb2f8b459f619e0c50fd6ff87b902c72ee1'
url TestHelper.local_binary_url('xarcontainer.xar')
homepage 'http://example.com/xar-container'
app 'xarcontainer/Application.app'
end

View File

@ -1,11 +0,0 @@
test_cask 'xzipped-asset' do
version '1.2.3'
sha256 '839263f474edde1d54a9101606e6f0dc9d963acc93f6dcc5af8d10ebc3187c02'
url TestHelper.local_binary_url('xzipped-asset.xz')
homepage 'http://example.com/xzipped-asset'
depends_on formula: 'xz'
app 'xzipped-asset--1.2.3'
end

Binary file not shown.

Binary file not shown.