inspec/test
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
..
cookbooks/os_prepare Add wildcard support to Utils::FindFiles (#2159) 2017-09-23 09:17:34 +02:00
functional Allow inspec check to ignore only_if (#2250) 2017-12-05 14:13:41 +01:00
integration wmi resource: properly escape quotes in WMI query (#2342) 2017-11-29 12:01:44 +01:00
unit Allow inspec check to ignore only_if (#2250) 2017-12-05 14:13:41 +01:00
docker_run.rb travis experiment: lower docker concurrency 2016-08-10 12:52:21 +01:00
docker_test.rb Load all dependent libraries, even if include_context isn't called 2016-09-04 20:55:20 +02:00
helper.rb security_policy resource: use PID for filename instead of random (#2368) 2017-12-04 15:31:06 -05:00