aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-08 14:25:50 +0100
committerMarkus Reiter2017-02-10 17:19:19 +0100
commit24d50599410dacbb36decfc957a5933e19d6a205 (patch)
treedae3b0b787e5d13863ab04df3a9504cfc1fa14f2 /Library
parent20e85cc96feaa4cb4a9ddac64758297aa2bff728 (diff)
downloadbrew-24d50599410dacbb36decfc957a5933e19d6a205.tar.bz2
Convert generic artifact test to spec.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/spec/cask/artifact/generic_artifact_spec.rb (renamed from Library/Homebrew/cask/test/cask/artifact/generic_artifact_test.rb)20
1 files changed, 10 insertions, 10 deletions
diff --git a/Library/Homebrew/cask/test/cask/artifact/generic_artifact_test.rb b/Library/Homebrew/cask/spec/cask/artifact/generic_artifact_spec.rb
index 21584b92a..7d9128c0e 100644
--- a/Library/Homebrew/cask/test/cask/artifact/generic_artifact_test.rb
+++ b/Library/Homebrew/cask/spec/cask/artifact/generic_artifact_spec.rb
@@ -1,4 +1,4 @@
-require "test_helper"
+require "spec_helper"
describe Hbc::Artifact::Artifact do
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") }
before do
- TestHelper.install_without_artifacts(cask)
+ InstallHelper.install_without_artifacts(cask)
end
describe "with no target" do
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
- install_phase.must_raise Hbc::CaskInvalidError
+ expect(install_phase).to raise_error(Hbc::CaskInvalidError)
end
end
@@ -27,21 +27,21 @@ describe Hbc::Artifact::Artifact do
install_phase.call
end
- target_path.must_be :directory?
- source_path.wont_be :exist?
+ expect(target_path).to be_a_directory
+ expect(source_path).not_to exist
end
it "avoids clobbering an existing artifact" do
target_path.mkpath
- assert_raises Hbc::CaskError do
+ expect {
shutup do
install_phase.call
end
- end
+ }.to raise_error(Hbc::CaskError)
- source_path.must_be :directory?
- target_path.must_be :directory?
- File.identical?(source_path, target_path).must_equal false
+ expect(source_path).to be_a_directory
+ expect(target_path).to be_a_directory
+ expect(File.identical?(source_path, target_path)).to be false
end
end