Don't use slashes when loading casks in tests.

This commit is contained in:
Markus Reiter 2024-02-09 23:17:25 +01:00
parent d9263196a2
commit d42f419217
No known key found for this signature in database
GPG Key ID: 245293B51702655B
9 changed files with 33 additions and 33 deletions

View File

@ -21,7 +21,7 @@ describe Cask::Artifact::Artifact, :cask do
context "without target" do
it "fails to load" do
expect do
Cask::CaskLoader.load(cask_path("invalid/invalid-generic-artifact-no-target"))
Cask::CaskLoader.load("invalid-generic-artifact-no-target")
end.to raise_error(Cask::CaskInvalidError, /Generic Artifact.*requires.*target/)
end
end
@ -29,7 +29,7 @@ describe Cask::Artifact::Artifact, :cask do
context "with relative target" do
it "does not fail to load" do
expect do
Cask::CaskLoader.load(cask_path("generic-artifact-relative-target"))
Cask::CaskLoader.load("generic-artifact-relative-target")
end.not_to raise_error
end
end
@ -37,7 +37,7 @@ describe Cask::Artifact::Artifact, :cask do
context "with user-relative target" do
it "does not fail to load" do
expect do
Cask::CaskLoader.load(cask_path("generic-artifact-user-relative-target"))
Cask::CaskLoader.load("generic-artifact-user-relative-target")
end.not_to raise_error
end
end

View File

@ -1,10 +1,10 @@
# frozen_string_literal: true
describe Cask::Artifact::Manpage, :cask do
let(:cask) { Cask::CaskLoader.load(cask_path(cask_token)) }
let(:cask) { Cask::CaskLoader.load(cask_token) }
context "without section" do
let(:cask_token) { "invalid/invalid-manpage-no-section" }
let(:cask_token) { "invalid-manpage-no-section" }
it "fails to load a cask without section" do
expect { cask }.to raise_error(Cask::CaskInvalidError, /is not a valid man page name/)

View File

@ -518,61 +518,61 @@ describe Cask::Audit, :cask do
let(:message) { /Version '[^']*' differs from '[^']*' retrieved by livecheck\./ }
context "when the Cask has a livecheck block using skip" do
let(:cask_token) { "livecheck/livecheck-skip" }
let(:cask_token) { "livecheck-skip" }
it { is_expected.not_to error_with(message) }
end
context "when the Cask has a livecheck block referencing a Cask using skip" do
let(:cask_token) { "livecheck/livecheck-skip-reference" }
let(:cask_token) { "livecheck-skip-reference" }
it { is_expected.not_to error_with(message) }
end
context "when the Cask is deprecated" do
let(:cask_token) { "livecheck/livecheck-deprecated" }
let(:cask_token) { "livecheck-deprecated" }
it { is_expected.not_to error_with(message) }
end
context "when the Cask has a livecheck block referencing a deprecated Cask" do
let(:cask_token) { "livecheck/livecheck-deprecated-reference" }
let(:cask_token) { "livecheck-deprecated-reference" }
it { is_expected.not_to error_with(message) }
end
context "when the Cask is disabled" do
let(:cask_token) { "livecheck/livecheck-disabled" }
let(:cask_token) { "livecheck-disabled" }
it { is_expected.not_to error_with(message) }
end
context "when the Cask has a livecheck block referencing a disabled Cask" do
let(:cask_token) { "livecheck/livecheck-disabled-reference" }
let(:cask_token) { "livecheck-disabled-reference" }
it { is_expected.not_to error_with(message) }
end
context "when version is :latest" do
let(:cask_token) { "livecheck/livecheck-version-latest" }
let(:cask_token) { "livecheck-version-latest" }
it { is_expected.not_to error_with(message) }
end
context "when the Cask has a livecheck block referencing a Cask where version is :latest" do
let(:cask_token) { "livecheck/livecheck-version-latest-reference" }
let(:cask_token) { "livecheck-version-latest-reference" }
it { is_expected.not_to error_with(message) }
end
context "when url is unversioned" do
let(:cask_token) { "livecheck/livecheck-url-unversioned" }
let(:cask_token) { "livecheck-url-unversioned" }
it { is_expected.not_to error_with(message) }
end
context "when the Cask has a livecheck block referencing a Cask with an unversioned url" do
let(:cask_token) { "livecheck/livecheck-url-unversioned-reference" }
let(:cask_token) { "livecheck-url-unversioned-reference" }
it { is_expected.not_to error_with(message) }
end

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
describe Cask::DSL, :cask do
let(:cask) { Cask::CaskLoader.load(cask_path(token)) }
let(:cask) { Cask::CaskLoader.load(token) }
let(:token) { "basic-cask" }
describe "stanzas" do
@ -43,7 +43,7 @@ describe Cask::DSL, :cask do
describe "header line" do
context "when invalid" do
let(:token) { "invalid/invalid-header-format" }
let(:token) { "invalid-header-format" }
it "raises an error" do
expect { cask }.to raise_error(Cask::CaskUnreadableError)
@ -51,7 +51,7 @@ describe Cask::DSL, :cask do
end
context "when token does not match the file name" do
let(:token) { "invalid/invalid-header-token-mismatch" }
let(:token) { "invalid-header-token-mismatch" }
it "raises an error" do
expect do
@ -309,7 +309,7 @@ describe Cask::DSL, :cask do
end
describe "url stanza" do
let(:token) { "invalid/invalid-two-url" }
let(:token) { "invalid-two-url" }
it "prevents defining multiple urls" do
expect { cask }.to raise_error(Cask::CaskInvalidError, /'url' stanza may only appear once/)
@ -317,7 +317,7 @@ describe Cask::DSL, :cask do
end
describe "homepage stanza" do
let(:token) { "invalid/invalid-two-homepage" }
let(:token) { "invalid-two-homepage" }
it "prevents defining multiple homepages" do
expect { cask }.to raise_error(Cask::CaskInvalidError, /'homepage' stanza may only appear once/)
@ -325,7 +325,7 @@ describe Cask::DSL, :cask do
end
describe "version stanza" do
let(:token) { "invalid/invalid-two-version" }
let(:token) { "invalid-two-version" }
it "prevents defining multiple versions" do
expect { cask }.to raise_error(Cask::CaskInvalidError, /'version' stanza may only appear once/)
@ -333,7 +333,7 @@ describe Cask::DSL, :cask do
end
describe "arch stanza" do
let(:token) { "invalid/invalid-two-arch" }
let(:token) { "invalid-two-arch" }
it "prevents defining multiple arches" do
expect { cask }.to raise_error(Cask::CaskInvalidError, /'arch' stanza may only appear once/)
@ -365,7 +365,7 @@ describe Cask::DSL, :cask do
end
describe "depends_on stanza" do
let(:token) { "invalid/invalid-depends-on-key" }
let(:token) { "invalid-depends-on-key" }
it "refuses to load with an invalid depends_on key" do
expect { cask }.to raise_error(Cask::CaskInvalidError)
@ -410,7 +410,7 @@ describe Cask::DSL, :cask do
describe "depends_on macos" do
context "when the depends_on macos value is invalid" do
let(:token) { "invalid/invalid-depends-on-macos-bad-release" }
let(:token) { "invalid-depends-on-macos-bad-release" }
it "refuses to load" do
expect { cask }.to raise_error(Cask::CaskInvalidError)
@ -418,7 +418,7 @@ describe Cask::DSL, :cask do
end
context "when there are conflicting depends_on macos forms" do
let(:token) { "invalid/invalid-depends-on-macos-conflicting-forms" }
let(:token) { "invalid-depends-on-macos-conflicting-forms" }
it "refuses to load" do
expect { cask }.to raise_error(Cask::CaskInvalidError)
@ -436,7 +436,7 @@ describe Cask::DSL, :cask do
end
context "with invalid depends_on arch value" do
let(:token) { "invalid/invalid-depends-on-arch-value" }
let(:token) { "invalid-depends-on-arch-value" }
it "refuses to load" do
expect { cask }.to raise_error(Cask::CaskInvalidError)
@ -454,7 +454,7 @@ describe Cask::DSL, :cask do
end
context "with invalid conflicts_with key" do
let(:token) { "invalid/invalid-conflicts-with-key" }
let(:token) { "invalid-conflicts-with-key" }
it "refuses to load invalid conflicts_with key" do
expect { cask }.to raise_error(Cask::CaskInvalidError)
@ -495,7 +495,7 @@ describe Cask::DSL, :cask do
end
context "when there is are activatable artifacts" do
let(:token) { "invalid/invalid-stage-only-conflict" }
let(:token) { "invalid-stage-only-conflict" }
it "prevents specifying stage_only" do
expect { cask }.to raise_error(Cask::CaskInvalidError, /'stage_only' must be the only activatable artifact/)

View File

@ -11,7 +11,7 @@ cask "livecheck-deprecated-reference" do
homepage "http://localhost/homebrew/test/cask/audit/livecheck/deprecated"
livecheck do
cask "livecheck/livecheck-deprecated"
cask "livecheck-deprecated"
end
app "TestCask.app"

View File

@ -11,7 +11,7 @@ cask "livecheck-disabled-reference" do
homepage "http://localhost/homebrew/test/cask/audit/livecheck/disabled"
livecheck do
cask "livecheck/livecheck-disabled"
cask "livecheck-disabled"
end
app "TestCask.app"

View File

@ -11,7 +11,7 @@ cask "livecheck-skip-reference" do
homepage "http://localhost/homebrew/test/cask/audit/livecheck/livecheck-skip"
livecheck do
cask "livecheck/livecheck-skip"
cask "livecheck-skip"
end
app "TestCask.app"

View File

@ -11,7 +11,7 @@ cask "livecheck-url-unversioned-reference" do
homepage "http://localhost/homebrew/test/cask/audit/livecheck/url-unversioned"
livecheck do
cask "livecheck/livecheck-url-unversioned"
cask "livecheck-url-unversioned"
end
app "TestCask.app"

View File

@ -11,7 +11,7 @@ cask "livecheck-version-latest-reference" do
homepage "http://localhost/homebrew/test/cask/audit/livecheck/version-latest"
livecheck do
cask "livecheck/livecheck-version-latest"
cask "livecheck-version-latest"
end
app "TestCask.app"