Class: Riot::Setup

Inherits:
RunnableBlock show all
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

#definition

Instance Method Summary collapse

Methods inherited from RunnableBlock

#to_s

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.

Parameters:

Returns:

  • (Array<Symbol>)

    array containing the evaluation state



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