inspec/test/unit/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
..
control_eval_context_test.rb Allow inspec check to ignore only_if (#2250) 2017-12-05 14:13:41 +01:00
library_eval_context_test.rb control and lib eval unit tests 2017-01-04 11:33:14 -05:00
metadata_test.rb Issue warning during check if profile name contains slash (#2231) 2017-11-09 12:32:54 +01:00
profile_context_test.rb Eliminate deprecation warnings on resource skipped messages (#2296) 2017-11-09 12:25:11 +01:00
profile_resource_exceptions_test.rb Allow skipping/failing resources in FilterTable (#2349) 2017-11-29 07:32:40 -05:00
profile_test.rb Issue warning during check if profile name contains slash (#2231) 2017-11-09 12:32:54 +01:00