Module: Lopata::ActiveRecord::DSL
- Included in:
- ScenarioBuilder
- Defined in:
- lib/lopata/active_record.rb
Overview
To be included in Lopata::ScenarioBuilder. The methods may be used in build time.
Instance Method Summary collapse
-
#cleanup(*vars, &block) ⇒ Object
Mark instance variables to call #destroy at teardown phase of scenario or context running.
Instance Method Details
#cleanup(*vars, &block) ⇒ Object
Mark instance variables to call #destroy at teardown phase of scenario or context running.
Does nothing if ‘keep’ mode is enabled.
116 117 118 119 120 121 122 123 |
# File 'lib/lopata/active_record.rb', line 116 def cleanup(*vars, &block) unless vars.empty? teardown do cleanup vars.map { |v| instance_variable_get "@#{v}" } end end teardown &block if block_given? end |