Class: Spectus::Sandbox Private
- Inherits:
-
Object
- Object
- Spectus::Sandbox
- Defined in:
- lib/spectus/sandbox.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This class evaluate the expectation with the passed block.
Instance Attribute Summary collapse
- #exception ⇒ Object readonly private
- #got ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(definition, negate) {|actual| ... } ⇒ Sandbox
constructor
private
Execute the untested code from the passed block against the definition.
-
#pass? ⇒ Boolean
private
Return the result.
Constructor Details
#initialize(definition, negate) {|actual| ... } ⇒ Sandbox
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Execute the untested code from the passed block against the definition.
16 17 18 19 20 |
# File 'lib/spectus/sandbox.rb', line 16 def initialize(definition, negate, &actual) @got = negate ^ Matcher.pass?(definition, &actual) rescue => e @exception = e end |
Instance Attribute Details
#exception ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/spectus/sandbox.rb', line 9 def exception @exception end |
#got ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/spectus/sandbox.rb', line 9 def got @got end |
Instance Method Details
#pass? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the result.
25 26 27 28 29 30 31 |
# File 'lib/spectus/sandbox.rb', line 25 def pass? if defined?(@exception) false else @got end end |