inspec/lib
Jerry Aldrich III 71057675de Allow skipping/failing resources in FilterTable (#2349)
* Allow skipping/failing resources in FilterTable

`FilterTable` is commonly used in the class body of a resource and is
evaluated during an `instance_eval`. This means that if you raise an
exception (e.g. SkipResource) it will halt `inspec exec` and
`inspec check`.

This adds an `ExceptionCatcher` class that will postpone evaluation
until test execution.

This allows `inspec check` and `inspec exec` to perform as intended when
skipping/failing a resource in `FilterTable`

Huge thanks to @adamleff for providing the starting code/ideas!

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

* Comment why `ExceptionCatcher` doesn't raise

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

* Remove `accessor` from `ExceptionCatcher`

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

* Return the existing ExceptionCatcher object rather than creating new

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-29 07:32:40 -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.46.1 by Expeditor 2017-11-29 11:02:12 +00:00
matchers Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
resources wmi resource: properly escape quotes in WMI query (#2342) 2017-11-29 12:01:44 +01:00
source_readers Bump Rubocop to 0.49.1 (#2323) 2017-11-21 08:49:41 +01:00
utils Allow skipping/failing resources in FilterTable (#2349) 2017-11-29 07:32:40 -05:00
inspec.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00