Class: Lime::Scenario::Scope

Inherits:
Module
  • Object
show all
Defined in:
lib/lime/scenario.rb

Instance Method Summary collapse

Constructor Details

#initialize(scenario, &block) ⇒ Scope

Returns a new instance of Scope.



113
114
115
116
117
118
119
# File 'lib/lime/scenario.rb', line 113

def initialize(scenario, &block)
  @scenario = scenario

  #include(scenario.feature.scope)

  module_eval(&block)
end

Instance Method Details

#Given(label) ⇒ Object Also known as: given

Given …

Parameters:

  • description (String)

    A matching description of the given procedure.



126
127
128
# File 'lib/lime/scenario.rb', line 126

def Given(label)
  @scenario.steps << Step.new(@scenario, label, :type=>:given)
end

#Then(label) ⇒ Object Also known as: hence

Then …

Parameters:

  • label (String)

    A matching description of the then procedure.



148
149
150
# File 'lib/lime/scenario.rb', line 148

def Then(label)
  @scenario.steps << Step.new(@scenario, label, :type=>:then)
end

#When(label) ⇒ Object Also known as: wence

When …

Parameters:

  • label (String)

    A matching description of the when procedure.



137
138
139
# File 'lib/lime/scenario.rb', line 137

def When(label)
  @scenario.steps << Step.new(@scenario, label, :type=>:when)
end