Class: CucumberMonitor::Scenario
- Inherits:
-
Object
- Object
- CucumberMonitor::Scenario
- Defined in:
- lib/cucumber_monitor/scenario.rb
Instance Attribute Summary collapse
-
#feature ⇒ Object
Returns the value of attribute feature.
-
#keyword ⇒ Object
Returns the value of attribute keyword.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, feature) ⇒ Scenario
constructor
A new instance of Scenario.
- #print_steps ⇒ Object
- #steps ⇒ Object
Constructor Details
#initialize(name, feature) ⇒ Scenario
Returns a new instance of Scenario.
9 10 11 12 13 |
# File 'lib/cucumber_monitor/scenario.rb', line 9 def initialize(name,feature) @name = name @keyword = I18n.t("scenario") @feature = feature end |
Instance Attribute Details
#feature ⇒ Object
Returns the value of attribute feature.
7 8 9 |
# File 'lib/cucumber_monitor/scenario.rb', line 7 def feature @feature end |
#keyword ⇒ Object
Returns the value of attribute keyword.
7 8 9 |
# File 'lib/cucumber_monitor/scenario.rb', line 7 def keyword @keyword end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/cucumber_monitor/scenario.rb', line 7 def name @name end |
Instance Method Details
#print_steps ⇒ Object
34 35 36 37 38 39 |
# File 'lib/cucumber_monitor/scenario.rb', line 34 def print_steps steps.each do |step| puts step end nil end |
#steps ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cucumber_monitor/scenario.rb', line 15 def steps st = [] started = false stopped = false record = false count = 0 feature.lines.each_with_index do |line, i| if line.include?(name) started = true end if started && !stopped st << Step.new(line.strip, self, i+1) unless (count == 0 || line.strip.blank?) stopped = true if line.strip.blank? count += 1 end end st end |