Add broken test, revealing test helper flaw

This commit adds a broken test, which is meant to expose a flaw in the
constructor of `Cask::Config`.

That (broken) test still passes because there’s also a flaw in our
test helper code.

The helper flaw happens to neutralize the `Cask::Config` flaw.
This commit is contained in:
Claudia 2020-04-27 15:00:22 +02:00
parent dd3267ece0
commit cad8be3278
No known key found for this signature in database
GPG Key ID: 246AC3C0F10BE51F

View File

@ -67,7 +67,18 @@ describe Cask::Config, :cask do
end end
context "when installing a cask and then adding a global default dir" do context "when installing a cask and then adding a global default dir" do
let(:config) { described_class.new(default: { appdir: "/default/path/before/adding/fontdir" }) } let(:config) {
json = <<~EOS
{
"default": {
"appdir": "/default/path/before/adding/fontdir"
},
"env": {},
"explicit": {}
}
EOS
described_class.from_json(json)
}
describe "#appdir" do describe "#appdir" do
it "honors metadata of the installed cask" do it "honors metadata of the installed cask" do