From cad8be3278923c926df2424b7a22be489ed03ded Mon Sep 17 00:00:00 2001 From: Claudia Date: Mon, 27 Apr 2020 15:00:22 +0200 Subject: [PATCH] Add broken test, revealing test helper flaw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Library/Homebrew/test/cask/config_spec.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/test/cask/config_spec.rb b/Library/Homebrew/test/cask/config_spec.rb index 6add7d7360..412d5f5b85 100644 --- a/Library/Homebrew/test/cask/config_spec.rb +++ b/Library/Homebrew/test/cask/config_spec.rb @@ -67,7 +67,18 @@ describe Cask::Config, :cask do end 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 it "honors metadata of the installed cask" do