Class: Rutema::Scenario

Inherits:
Object
  • Object
show all
Includes:
SpecificationElement
Defined in:
lib/rutema/core/objectmodel.rb

Overview

A Rutema::Scenario is a sequence of Rutema::Step instances.

Rutema::Step instances are run in the definition sequence and the scenario is succesfull when all steps are succesfull.

From the execution point of view each step is either succesfull or failed and it depends on the exit code of the step's command.

Failure in a step results in the interruption of execution and the report of the errors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SpecificationElement

#attribute, #method_missing, #respond_to?, #respond_to_missing?

Constructor Details

#initialize(steps) ⇒ Scenario

Returns a new instance of Scenario.



127
128
129
130
131
# File 'lib/rutema/core/objectmodel.rb', line 127

def initialize(steps)
  @attributes = {}
  @steps = steps
  @steps ||= []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rutema::SpecificationElement

Instance Attribute Details

#stepsObject

Returns the value of attribute steps.



125
126
127
# File 'lib/rutema/core/objectmodel.rb', line 125

def steps
  @steps
end

Instance Method Details

#add_step(step) ⇒ Object

Adds a step at the end of the step sequence



134
135
136
# File 'lib/rutema/core/objectmodel.rb', line 134

def add_step(step)
  @steps << step
end