Class: Cucumber::Formatter::LegacyApi::Results
- Defined in:
- lib/cucumber/formatter/legacy_api/results.rb
Instance Method Summary collapse
-
#initialize ⇒ Results
constructor
A new instance of Results.
-
#scenario_visited(scenario) ⇒ Object
:nodoc:.
-
#scenarios(status = nil) ⇒ Object
:nodoc:.
-
#step_visited(step) ⇒ Object
:nodoc:.
-
#steps(status = nil) ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ Results
Returns a new instance of Results.
6 7 8 9 10 |
# File 'lib/cucumber/formatter/legacy_api/results.rb', line 6 def initialize # Optimization - quicker lookup. @inserted_steps = {} @inserted_scenarios = {} end |
Instance Method Details
#scenario_visited(scenario) ⇒ Object
:nodoc:
21 22 23 24 25 26 27 28 |
# File 'lib/cucumber/formatter/legacy_api/results.rb', line 21 def scenario_visited(scenario) #:nodoc: scenario_id = scenario.object_id unless @inserted_scenarios.has_key?(scenario_id) @inserted_scenarios[scenario_id] = scenario scenarios.push(scenario) end end |
#scenarios(status = nil) ⇒ Object
:nodoc:
39 40 41 42 43 44 45 46 |
# File 'lib/cucumber/formatter/legacy_api/results.rb', line 39 def scenarios(status = nil) #:nodoc: @scenarios ||= [] if(status) @scenarios.select{|scenario| scenario.status == status} else @scenarios end end |
#step_visited(step) ⇒ Object
:nodoc:
12 13 14 15 16 17 18 19 |
# File 'lib/cucumber/formatter/legacy_api/results.rb', line 12 def step_visited(step) #:nodoc: step_id = step.object_id unless @inserted_steps.has_key?(step_id) @inserted_steps[step_id] = step steps.push(step) end end |
#steps(status = nil) ⇒ Object
:nodoc:
30 31 32 33 34 35 36 37 |
# File 'lib/cucumber/formatter/legacy_api/results.rb', line 30 def steps(status = nil) #:nodoc: @steps ||= [] if(status) @steps.select{|step| step.status == status} else @steps end end |