aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMarkus Reiter2017-10-04 15:47:53 +0200
committerMarkus Reiter2017-10-04 18:47:55 +0200
commit2c7ef064e4ff0833ac94a4f18f5049ad17c30b7c (patch)
tree38e60fd7f4691f57a806f59b5ff20c2401e5c0bc /Library/Homebrew/test
parent57035b3ba4b8361c0e764575348607cc18b64ae7 (diff)
downloadbrew-2c7ef064e4ff0833ac94a4f18f5049ad17c30b7c.tar.bz2
Refactor DSL and Artifacts.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/cask/dsl_spec.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/Library/Homebrew/test/cask/dsl_spec.rb b/Library/Homebrew/test/cask/dsl_spec.rb
index 7df8de6f8..e03af9aef 100644
--- a/Library/Homebrew/test/cask/dsl_spec.rb
+++ b/Library/Homebrew/test/cask/dsl_spec.rb
@@ -216,12 +216,12 @@ describe Hbc::DSL, :cask do
app "Bar.app"
end
- expect(cask.artifacts[:app].map(&:to_s)).to eq(["Foo.app (App)", "Bar.app (App)"])
+ expect(cask.artifacts[Hbc::Artifact::App].map(&:to_s)).to eq(["Foo.app (App)", "Bar.app (App)"])
end
it "allow app stanzas to be empty" do
cask = Hbc::Cask.new("cask-with-no-apps")
- expect(cask.artifacts[:app]).to be_empty
+ expect(cask.artifacts[Hbc::Artifact::App]).to be_empty
end
end
@@ -249,7 +249,7 @@ describe Hbc::DSL, :cask do
pkg "Bar.pkg"
end
- expect(cask.artifacts[:pkg].map(&:to_s)).to eq(["Foo.pkg (Pkg)", "Bar.pkg (Pkg)"])
+ expect(cask.artifacts[Hbc::Artifact::Pkg].map(&:to_s)).to eq(["Foo.pkg (Pkg)", "Bar.pkg (Pkg)"])
end
end
@@ -501,10 +501,10 @@ describe Hbc::DSL, :cask do
let(:token) { "with-installer-script" }
it "allows installer script to be specified" do
- expect(cask.artifacts[:installer].first.path).to eq(Pathname("/usr/bin/true"))
- expect(cask.artifacts[:installer].first.args[:args]).to eq(["--flag"])
- expect(cask.artifacts[:installer].to_a[1].path).to eq(Pathname("/usr/bin/false"))
- expect(cask.artifacts[:installer].to_a[1].args[:args]).to eq(["--flag"])
+ expect(cask.artifacts[Hbc::Artifact::Installer].first.path).to eq(Pathname("/usr/bin/true"))
+ expect(cask.artifacts[Hbc::Artifact::Installer].first.args[:args]).to eq(["--flag"])
+ expect(cask.artifacts[Hbc::Artifact::Installer].to_a[1].path).to eq(Pathname("/usr/bin/false"))
+ expect(cask.artifacts[Hbc::Artifact::Installer].to_a[1].args[:args]).to eq(["--flag"])
end
end
@@ -512,7 +512,7 @@ describe Hbc::DSL, :cask do
let(:token) { "with-installer-manual" }
it "allows installer manual to be specified" do
- installer = cask.artifacts[:installer].first
+ installer = cask.artifacts[Hbc::Artifact::Installer].first
expect(installer).to be_a(Hbc::Artifact::Installer::ManualInstaller)
expect(installer.path).to eq(cask.staged_path.join("Caffeine.app"))
end
@@ -524,7 +524,7 @@ describe Hbc::DSL, :cask do
let(:token) { "stage-only" }
it "allows stage_only stanza to be specified" do
- expect(cask.artifacts[:stage_only]).not_to be_empty
+ expect(cask.artifacts[Hbc::Artifact::StageOnly]).not_to be_empty
end
end
@@ -550,7 +550,7 @@ describe Hbc::DSL, :cask do
let(:token) { "appdir-interpolation" }
it "is allowed" do
- expect(cask.artifacts[:binary].first.source).to eq(Hbc.appdir/"some/path")
+ expect(cask.artifacts[Hbc::Artifact::Binary].first.source).to eq(Hbc.appdir/"some/path")
end
end
@@ -563,7 +563,7 @@ describe Hbc::DSL, :cask do
binary "#{appdir}/some/path"
end
- expect(cask.artifacts[:binary].first.source).to eq(original_appdir/"some/path")
+ expect(cask.artifacts[Hbc::Artifact::Binary].first.source).to eq(original_appdir/"some/path")
ensure
Hbc.appdir = original_appdir
end