Module: EacRubyGemSupport::Rspec::Helpers::Utils

Defined in:
lib/eac_ruby_gem_support/rspec/helpers/utils.rb

Instance Method Summary collapse

Instance Method Details

#capture_errorStandardError?

Returns If block raises an error, return this error. If not, return nil.

Returns:

  • (StandardError, nil)

    If block raises an error, return this error. If not, return nil.



13
14
15
16
17
18
# File 'lib/eac_ruby_gem_support/rspec/helpers/utils.rb', line 13

def capture_error
  yield
  nil
rescue ::StandardError => e
  e
end