inspec/test/unit/mock/profiles
Jerry Aldrich III 49d36de0f3 Allow inspec check to ignore only_if (#2250)
* Allow `inspec check` to ignore `only_if`

When using `inspec check` a mock Train backend is created. This means
that the following would raise an error because `os.name` is `nil`

```
only_if { os.name.include?('anything') }
```

Since `inspec check` isn't concerned with the evaluation of `only_if`
this skips those checks if the block given raises an error.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Remove unnecessary `e` in rescue

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Modify implementation to use `check_mode`

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Move `check_mode` concept to the Profile scope

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Fix lint after rubocop upgrade

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Add comment for mocked ControlEvalContext options

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-12-05 14:13:41 +01:00
..
complete-metadata update unit tests 2017-05-31 00:21:05 -05:00
complete-profile Source reader should not hand back files with nil contents (#2003) 2017-07-11 21:33:55 +02:00
dependencies Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
empty-metadata add profile tests (non-legacy) 2016-01-20 21:57:23 +01:00
failures Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
invalid-version update unit tests 2017-05-31 00:21:05 -05:00
legacy-complete-metadata update unit tests 2017-05-31 00:21:05 -05:00
legacy-empty-metadata clearly identify legacy profile tests and fix identification 2016-01-19 15:48:06 +01:00
legacy-simple-metadata add profile tests (non-legacy) 2016-01-20 21:57:23 +01:00
library Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
license-invalid update unit tests 2017-05-31 00:21:05 -05:00
license-proprietary Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
license-spdx update unit tests 2017-05-31 00:21:05 -05:00
only-if-os-nope Allow inspec check to ignore only_if (#2250) 2017-12-05 14:13:41 +01:00
profile-support-skip Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
profile-with-bad-metadata Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
profile-with-resource-exceptions Allow skipping/failing resources in FilterTable (#2349) 2017-11-29 07:32:40 -05:00
simple-inheritance fix inherited profile cli report 2016-09-04 18:28:01 +02:00
simple-metadata add profile tests (non-legacy) 2016-01-20 21:57:23 +01:00
skippy-controls Show skip_message and correct title 2016-09-23 07:47:21 +01:00
skippy-profile-os Use only strings in resource examples, docs and tests 2016-05-03 23:27:18 +01:00
slash-in-name/not-allowed Issue warning during check if profile name contains slash (#2231) 2017-11-09 12:32:54 +01:00
spec_only introduce cli report formatter 2016-06-15 17:11:29 +02:00
supermarket-dep Provide inspec.yml shortcut syntax 2016-09-14 08:46:06 +02:00
supported_inspec skip profiles if the platform isnt supported 2016-04-16 15:34:23 -04:00
unsupported_inspec skip profiles if the platform isnt supported 2016-04-16 15:34:23 -04:00
windows-only Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
{{special-path}} Modify DirProvider to allow special characters (#2174) 2017-09-23 09:16:25 +02:00