Class: CukePages::Scenario

Inherits:
Object
  • Object
show all
Defined in:
lib/cukepages/feature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#stepsObject (readonly)

Returns the value of attribute steps.



24
25
26
# File 'lib/cukepages/feature.rb', line 24

def steps
  @steps
end

#titleObject (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_sObject



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