Class: ConvenientService::RSpec::PrimitiveHelpers::Classes::IgnoringException
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::RSpec::PrimitiveHelpers::Classes::IgnoringException
- Defined in:
- lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb,
lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception/exceptions.rb
Defined Under Namespace
Modules: Exceptions
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
- #call ⇒ ConvenientService::Support::UniqueValue
-
#initialize(exception, &block) ⇒ IgnoringException
constructor
A new instance of IgnoringException.
Methods inherited from Support::Command
Constructor Details
#initialize(exception, &block) ⇒ IgnoringException
Returns a new instance of IgnoringException.
26 27 28 29 |
# File 'lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb', line 26 def initialize(exception, &block) @exception = exception @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
20 21 22 |
# File 'lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb', line 20 def block @block end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
14 15 16 |
# File 'lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb', line 14 def exception @exception end |
Instance Method Details
#call ⇒ ConvenientService::Support::UniqueValue
Note:
Rescue ‘StandardError`, NOT `Exception`.
40 41 42 43 44 45 46 |
# File 'lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb', line 40 def call block.call rescue exception Support::UNDEFINED else ::ConvenientService.raise Exceptions::IgnoredExceptionIsNotRaised.new(exception: exception) end |