Class: CukePages::Scenario
- Inherits:
-
Object
- Object
- CukePages::Scenario
- Defined in:
- lib/cukepages/feature.rb
Instance Attribute Summary collapse
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title, steps = []) ⇒ Scenario
constructor
A new instance of Scenario.
- #to_s ⇒ Object
Constructor Details
#initialize(title, steps = []) ⇒ Scenario
Returns a new instance of Scenario.
26 27 28 29 |
# File 'lib/cukepages/feature.rb', line 26 def initialize(title, steps=[]) @title = title @steps = steps end |
Instance Attribute Details
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
24 25 26 |
# File 'lib/cukepages/feature.rb', line 24 def steps @steps end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
24 25 26 |
# File 'lib/cukepages/feature.rb', line 24 def title @title end |
Instance Method Details
#to_s ⇒ Object
31 32 33 34 35 |
# File 'lib/cukepages/feature.rb', line 31 def to_s steps.inject("Scenario: #{title}\n") { |result, step| result << " " << step.to_s << "\n" } end |