Class: Cucumber::Core::Test::Runner::RunningTestCase

Inherits:
Object
  • Object
show all
Includes:
Messages::Helpers::TestStepResultComparator
Defined in:
lib/cucumber/core/test/runner.rb

Defined Under Namespace

Modules: Status

Instance Method Summary collapse

Constructor Details

#initializeRunningTestCase

Returns a new instance of RunningTestCase.



52
53
54
55
# File 'lib/cucumber/core/test/runner.rb', line 52

def initialize
  @timer = Timer.new.start
  @status = Status::Unknown.new(Result::Unknown.new)
end

Instance Method Details

#ambiguous(step_result) ⇒ Object



70
71
72
73
# File 'lib/cucumber/core/test/runner.rb', line 70

def ambiguous(step_result)
  failed(step_result)
  self
end

#duration(_step_duration, _step_result) ⇒ Object



99
100
101
# File 'lib/cucumber/core/test/runner.rb', line 99

def duration(_step_duration, _step_result)
  self
end

#exception(_step_exception, _step_result) ⇒ Object



95
96
97
# File 'lib/cucumber/core/test/runner.rb', line 95

def exception(_step_exception, _step_result)
  self
end

#execute(test_step) ⇒ Object



57
58
59
# File 'lib/cucumber/core/test/runner.rb', line 57

def execute(test_step, &)
  status.execute(test_step, self, &)
end

#failed(step_result) ⇒ Object



65
66
67
68
# File 'lib/cucumber/core/test/runner.rb', line 65

def failed(step_result)
  not_passing(step_result)
  self
end

#passed(step_result) ⇒ Object



75
76
77
78
# File 'lib/cucumber/core/test/runner.rb', line 75

def passed(step_result)
  @status = Status::Passing.new(step_result) if test_step_result_rankings[step_result.to_message.status] > test_step_result_rankings[status.step_result_message.status]
  self
end

#pending(_message, step_result) ⇒ Object



80
81
82
83
# File 'lib/cucumber/core/test/runner.rb', line 80

def pending(_message, step_result)
  failed(step_result)
  self
end

#resultObject



61
62
63
# File 'lib/cucumber/core/test/runner.rb', line 61

def result
  status.result(@timer.duration)
end

#skipped(step_result) ⇒ Object



85
86
87
88
# File 'lib/cucumber/core/test/runner.rb', line 85

def skipped(step_result)
  failed(step_result)
  self
end

#undefined(step_result) ⇒ Object



90
91
92
93
# File 'lib/cucumber/core/test/runner.rb', line 90

def undefined(step_result)
  failed(step_result)
  self
end