class FilterTable::ExceptionCatcher
def initialize(original_resource, original_exception)
def initialize(original_resource, original_exception) @original_resource = original_resource @original_exception = original_exception end
def method_missing(*)
def method_missing(*) self end
def resource_exception_message
def resource_exception_message @original_exception.message end
def resource_failed?
showing why the resource failed. This prevents the resource from
This method is called via the runner and signals RSpec to output a block
def resource_failed? @original_exception.is_a?(Inspec::Exceptions::ResourceFailed) end
def resource_skipped?
showing why the resource was skipped. This prevents the resource from
This method is called via the runner and signals RSpec to output a block
def resource_skipped? @original_exception.is_a?(Inspec::Exceptions::ResourceSkipped) end
def respond_to?(_method, include_all = false)
before calling it. We need to fake it out and tell it that it does. This
RSpec will check the object returned to see if it responds to a method
def respond_to?(_method, include_all = false) true end
def to_ary
Rspec is not able to convert FilterTable::ExceptionCatcher issue https://github.com/inspec/inspec/issues/5369
def to_ary [ to_s ] end
def to_s
def to_s "#{@original_resource} (#{@original_exception.message})" end