inspec/lib
Adam Leff 6c3ab70dd1
json resource (et. al.): allow inspec check to succeed when using command (#2317)
* json resource (et. al.): allow inspec check to succeed when using command

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>

* Make `resource_base_name` method private

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-27 11:13:02 -05:00
..
bundles Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
fetchers Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
inspec Bump version to 1.45.13 by Expeditor 2017-11-21 19:04:32 +00:00
matchers Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
resources json resource (et. al.): allow inspec check to succeed when using command (#2317) 2017-11-27 11:13:02 -05:00
source_readers Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
utils Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
inspec.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00