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

json resource (et. al.): allow inspec check to succeed when using command #2317

Merged
merged 2 commits into from Nov 27, 2017

Commits on Nov 27, 2017

  1. json resource (et. al.): allow inspec check to succeed when using com…

    …mand
    
    When using the `json` resource (or any of the resources that subclass
    JsonConfig), `inspec check` would fail if the content was supplied with
    the `command` option. This is because the `command` resource is mocked
    and an empty string would be returned for `stdout`. That content would
    be blindly passed to the `parse` method would which raise an exception
    and cause `inspec check` to fail.
    
    This change refactors JsonConfig to be a bit cleaner and use some helper
    methods. Additionally, we use the new Exceptions to properly raise errors
    which are naturally caught by Inspec::Profile, etc.
    
    Signed-off-by: Adam Leff <adam@leff.co>
    adamleff committed Nov 27, 2017
    Configuration menu
    Copy the full SHA
    7bfe865 View commit details
    Browse the repository at this point in the history
  2. Make resource_base_name method private

    Signed-off-by: Adam Leff <adam@leff.co>
    adamleff committed Nov 27, 2017
    Configuration menu
    Copy the full SHA
    a145f25 View commit details
    Browse the repository at this point in the history