Module: Hornsby::Helper
- Defined in:
- lib/hornsby/helper.rb
Instance Method Summary collapse
- #hornsby_clear(*args) ⇒ Object
- #hornsby_scenario(*names) ⇒ Object (also: #hornsby_scenarios)
Instance Method Details
#hornsby_clear(*args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/hornsby/helper.rb', line 10 def hornsby_clear(*args) = args. Hornsby.delete_tables(*args) if [:undo] == :all Hornsby.executed_scenarios.clear else undo = [[:undo]].flatten.compact unless (not_found = undo - Hornsby.executed_scenarios.to_a).blank? raise(ArgumentError, "Scenario(s) #{not_found} not found") end Hornsby.executed_scenarios -= undo end end |
#hornsby_scenario(*names) ⇒ Object Also known as: hornsby_scenarios
3 4 5 6 |
# File 'lib/hornsby/helper.rb', line 3 def hornsby_scenario(*names) Hornsby.build(*names) Hornsby.copy_ivars(self) end |