Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cask loader: add missing canonicalisation #7451

Merged
merged 4 commits into from Apr 27, 2020
Merged

Cask loader: add missing canonicalisation #7451

merged 4 commits into from Apr 27, 2020

Commits on Apr 27, 2020

  1. Add test for JSON-based cask config loader

    Previously, the JSON-based cask config loader was untested.
    This commit changes the interface to accept a string, making the loader
    easier to test. The commit also adds a test.
    claui committed Apr 27, 2020
    Configuration menu
    Copy the full SHA
    dd3267e View commit details
    Browse the repository at this point in the history
  2. 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.
    claui committed Apr 27, 2020
    Configuration menu
    Copy the full SHA
    cad8be3 View commit details
    Browse the repository at this point in the history
  3. Fix flaw in Cask test helper

    This commit fixes a flaw in the Cask test helper, causing the broken `Cask::Config` test to actually fail.
    
    The flaw occurred while patching the `Cask::Config::DEFAULT_DIRS` hash.
    While the original hash uses strings as values, the patched one used
    `Pathname` values, masking a broken `Cask::Config::from_json` test.
    
    Now the broken test fails like it should.
    claui committed Apr 27, 2020
    Configuration menu
    Copy the full SHA
    c85df70 View commit details
    Browse the repository at this point in the history
  4. Make sure DEFAULT_DIRS values are Pathnames

    This commit fixes the PR #7417 bug.
    
    The call to `canonicalize` needs to wrap `DEFAULT_DIRS`, not the
    other way around. This was mixed up in PR #7417 due to an oversight.
    claui committed Apr 27, 2020
    Configuration menu
    Copy the full SHA
    b8aa808 View commit details
    Browse the repository at this point in the history