Class: Lime::Step
- Inherits:
-
Object
- Object
- Lime::Step
- Defined in:
- lib/lime/step.rb
Overview
Test step.
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Label of test.
-
#scenario ⇒ Object
readonly
The scenario to which this step belongs.
-
#type ⇒ Object
readonly
The type of step (:given, :when or :then).
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(scenario, label, settings = {}) ⇒ Step
constructor
New unit test procedure.
- #omit=(boolean) ⇒ Object
- #omit? ⇒ Boolean
-
#subject ⇒ Object
FIXME.
- #to_proc ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(scenario, label, settings = {}) ⇒ Step
New unit test procedure.
9 10 11 12 13 14 15 16 17 |
# File 'lib/lime/step.rb', line 9 def initialize(scenario, label, settings={}) @scenario = scenario @label = label @type = settings[:type] @omit = false #@tested = false end |
Instance Attribute Details
#label ⇒ Object (readonly)
Label of test.
26 27 28 |
# File 'lib/lime/step.rb', line 26 def label @label end |
#scenario ⇒ Object (readonly)
The scenario to which this step belongs.
23 24 25 |
# File 'lib/lime/step.rb', line 23 def scenario @scenario end |
#type ⇒ Object (readonly)
The type of step (:given, :when or :then).
20 21 22 |
# File 'lib/lime/step.rb', line 20 def type @type end |
Instance Method Details
#call ⇒ Object
58 59 60 |
# File 'lib/lime/step.rb', line 58 def call scenario.run(self) end |
#omit=(boolean) ⇒ Object
34 35 36 |
# File 'lib/lime/step.rb', line 34 def omit=(boolean) @omit = boolean end |
#omit? ⇒ Boolean
29 30 31 |
# File 'lib/lime/step.rb', line 29 def omit? @omit end |
#subject ⇒ Object
FIXME
44 45 |
# File 'lib/lime/step.rb', line 44 def subject end |
#to_proc ⇒ Object
48 49 50 |
# File 'lib/lime/step.rb', line 48 def to_proc lambda{ call } end |
#to_s ⇒ Object
39 40 41 |
# File 'lib/lime/step.rb', line 39 def to_s "#{type.to_s.capitalize} #{label}" end |