Class: Riot::Setup
- Inherits:
-
RunnableBlock
- Object
- RunnableBlock
- Riot::Setup
- Defined in:
- lib/riot/runnable.rb
Overview
Used to decorate a setup, hookup, a teardown or anything else that is about context administration.
Instance Attribute Summary
Attributes inherited from RunnableBlock
Instance Method Summary collapse
-
#initialize(&definition) ⇒ Setup
constructor
A new instance of Setup.
-
#run(situation) ⇒ Array<Symbol>
Calls Riot::Situation#setup with the predefined block at Context run-time.
Methods inherited from RunnableBlock
Constructor Details
#initialize(&definition) ⇒ Setup
Returns a new instance of Setup.
38 39 40 |
# File 'lib/riot/runnable.rb', line 38 def initialize(&definition) super("setup", &definition) end |
Instance Method Details
#run(situation) ⇒ Array<Symbol>
Calls Riot::Situation#setup with the predefined block at Context run-time. Though this is like every other kind of RunnableBlock, run
will not return a meaningful state, which means the reporter will likely not report anything.
48 49 50 51 52 53 |
# File 'lib/riot/runnable.rb', line 48 def run(situation) situation.setup(&definition) [:setup] rescue StandardError => e [:setup_error, e] end |