Class: Cucumber::Runtime::Results

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/runtime/results.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ Results

Returns a new instance of Results.



5
6
7
# File 'lib/cucumber/runtime/results.rb', line 5

def initialize(configuration)
  @configuration = configuration
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


35
36
37
38
39
40
41
42
# File 'lib/cucumber/runtime/results.rb', line 35

def failure?
  if @configuration.wip?
    scenarios(:passed).any?
  else
    scenarios(:failed).any? ||
    (@configuration.strict? && (steps(:undefined).any? || steps(:pending).any?))
  end
end

#scenario_visited(scenario) ⇒ Object

:nodoc:



13
14
15
# File 'lib/cucumber/runtime/results.rb', line 13

def scenario_visited(scenario) #:nodoc:
  scenarios << scenario unless scenarios.index(scenario)
end

#scenarios(status = nil) ⇒ Object

:nodoc:



26
27
28
29
30
31
32
33
# File 'lib/cucumber/runtime/results.rb', line 26

def scenarios(status = nil) #:nodoc:
  @scenarios ||= []
  if(status)
    @scenarios.select{|scenario| scenario.status == status}
  else
    @scenarios
  end
end

#step_visited(step) ⇒ Object

:nodoc:



9
10
11
# File 'lib/cucumber/runtime/results.rb', line 9

def step_visited(step) #:nodoc:
  steps << step unless steps.index(step)
end

#steps(status = nil) ⇒ Object

:nodoc:



17
18
19
20
21
22
23
24
# File 'lib/cucumber/runtime/results.rb', line 17

def steps(status = nil) #:nodoc:
  @steps ||= []
  if(status)
    @steps.select{|step| step.status == status}
  else
    @steps
  end
end