Convert generic artifact test to spec.
This commit is contained in:
parent
20e85cc96f
commit
24d5059941
@ -1,4 +1,4 @@
|
|||||||
require "test_helper"
|
require "spec_helper"
|
||||||
|
|
||||||
describe Hbc::Artifact::Artifact do
|
describe Hbc::Artifact::Artifact do
|
||||||
let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-generic-artifact.rb") }
|
let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-generic-artifact.rb") }
|
||||||
@ -11,14 +11,14 @@ describe Hbc::Artifact::Artifact do
|
|||||||
let(:target_path) { Hbc.appdir.join("Caffeine.app") }
|
let(:target_path) { Hbc.appdir.join("Caffeine.app") }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
TestHelper.install_without_artifacts(cask)
|
InstallHelper.install_without_artifacts(cask)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "with no target" do
|
describe "with no target" do
|
||||||
let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-generic-artifact-no-target.rb") }
|
let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-generic-artifact-no-target.rb") }
|
||||||
|
|
||||||
it "fails to install with no target" do
|
it "fails to install with no target" do
|
||||||
install_phase.must_raise Hbc::CaskInvalidError
|
expect(install_phase).to raise_error(Hbc::CaskInvalidError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -27,21 +27,21 @@ describe Hbc::Artifact::Artifact do
|
|||||||
install_phase.call
|
install_phase.call
|
||||||
end
|
end
|
||||||
|
|
||||||
target_path.must_be :directory?
|
expect(target_path).to be_a_directory
|
||||||
source_path.wont_be :exist?
|
expect(source_path).not_to exist
|
||||||
end
|
end
|
||||||
|
|
||||||
it "avoids clobbering an existing artifact" do
|
it "avoids clobbering an existing artifact" do
|
||||||
target_path.mkpath
|
target_path.mkpath
|
||||||
|
|
||||||
assert_raises Hbc::CaskError do
|
expect {
|
||||||
shutup do
|
shutup do
|
||||||
install_phase.call
|
install_phase.call
|
||||||
end
|
end
|
||||||
end
|
}.to raise_error(Hbc::CaskError)
|
||||||
|
|
||||||
source_path.must_be :directory?
|
expect(source_path).to be_a_directory
|
||||||
target_path.must_be :directory?
|
expect(target_path).to be_a_directory
|
||||||
File.identical?(source_path, target_path).must_equal false
|
expect(File.identical?(source_path, target_path)).to be false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user