inspec/test/functional
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
..
gitfetcher_test.rb Rename --no-write-lockfile to --no-create-lockfile 2016-09-22 10:08:32 +02:00
helper.rb Add sensitive flag to resources to restrict logging output (#2017) 2017-08-25 16:21:49 -04:00
inheritance_test.rb update functional tests 2016-11-04 18:01:28 +01:00
inspec_archive_test.rb Updating tests for profile versions 2016-12-14 16:20:27 +00:00
inspec_artifact_test.rb fix intermitten functional vendor test failures (#1919) 2017-06-12 14:01:26 +02:00
inspec_check_test.rb Allow skipping/failing resources in FilterTable (#2349) 2017-11-29 07:32:40 -05:00
inspec_compliance_test.rb Add Chef Automate support to inspec compliance login (#2203) 2017-10-26 17:32:47 +02:00
inspec_exec_json_test.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
inspec_exec_jsonmin_test.rb bugfix: remove duplicate message in describe.one blocks 2017-06-07 01:27:47 +02:00
inspec_exec_junit_test.rb Fix classname in JUnit formatter (#2283) 2017-11-13 22:41:37 -05:00
inspec_exec_test.rb Issue warning during check if profile name contains slash (#2231) 2017-11-09 12:32:54 +01:00
inspec_json_profile_test.rb Support PAX-formatted tar files, standardize file lists (#2225) 2017-10-10 10:36:57 +01:00
inspec_shell_test.rb Update shell resource help to return what is defined (#2219) 2017-10-06 19:32:16 +02:00
inspec_test.rb Added functional tests for inspec version --format json 2017-05-17 09:41:38 -04:00
inspec_vendor_test.rb fix intermitten functional vendor test failures (#1919) 2017-06-12 14:01:26 +02:00