Class: Matest::ExampleBeforeAssertion
- Defined in:
- lib/matest/example.rb
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.
76 77 78 79 |
# File 'lib/matest/example.rb', line 76 def initialize(example_block, description, lets) super set_state end |
Instance Method Details
#before_assertion_block ⇒ Object
87 88 89 |
# File 'lib/matest/example.rb', line 87 def before_assertion_block eval("proc { #{@code} }") end |
#set_state ⇒ Object
81 82 83 84 85 |
# File 'lib/matest/example.rb', line 81 def set_state before_sexp = example_block.sexp[0..-2] @code = Sorcerer.source(before_sexp) eval(@code) end |