Class: Matest::ExampleBeforeAssertion
- Defined in:
- lib/matest/example.rb
Instance Attribute Summary
Attributes inherited from Example
Instance Method Summary collapse
- #before_assertion_block ⇒ Object
-
#initialize(example_block, description, lets) ⇒ ExampleBeforeAssertion
constructor
A new instance of ExampleBeforeAssertion.
- #set_state ⇒ Object
Methods inherited from Example
#call, #description, #example_block, #just_before_assertion, let, #lets, local_var, #track_lets, #track_variables
Constructor Details
#initialize(example_block, description, lets) ⇒ ExampleBeforeAssertion
Returns a new instance of ExampleBeforeAssertion.
77 78 79 80 |
# File 'lib/matest/example.rb', line 77 def initialize(example_block, description, lets) super set_state end |
Instance Method Details
#before_assertion_block ⇒ Object
88 89 90 |
# File 'lib/matest/example.rb', line 88 def before_assertion_block eval("proc { #{@code} }") end |
#set_state ⇒ Object
82 83 84 85 86 |
# File 'lib/matest/example.rb', line 82 def set_state before_sexp = example_block.sexp[0..-2] @code = Sorcerer.source(before_sexp) eval(@code) end |