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.



148
149
150
151
# File 'lib/cucumber/core/test/runner.rb', line 148

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

Instance Method Details

#ambiguous(step_result) ⇒ Object



166
167
168
169
# File 'lib/cucumber/core/test/runner.rb', line 166

def ambiguous(step_result)
  failed(step_result)
  self
end

#duration(_step_duration, _step_result) ⇒ Object



195
196
197
# File 'lib/cucumber/core/test/runner.rb', line 195

def duration(_step_duration, _step_result)
  self
end

#exception(_step_exception, _step_result) ⇒ Object



191
192
193
# File 'lib/cucumber/core/test/runner.rb', line 191

def exception(_step_exception, _step_result)
  self
end

#execute(test_step) ⇒ Object



153
154
155
# File 'lib/cucumber/core/test/runner.rb', line 153

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

#failed(step_result) ⇒ Object



161
162
163
164
# File 'lib/cucumber/core/test/runner.rb', line 161

def failed(step_result)
  not_passing(step_result)
  self
end

#passed(step_result) ⇒ Object



171
172
173
174
# File 'lib/cucumber/core/test/runner.rb', line 171

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



176
177
178
179
# File 'lib/cucumber/core/test/runner.rb', line 176

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

#resultObject



157
158
159
# File 'lib/cucumber/core/test/runner.rb', line 157

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

#skipped(step_result) ⇒ Object



181
182
183
184
# File 'lib/cucumber/core/test/runner.rb', line 181

def skipped(step_result)
  failed(step_result)
  self
end

#undefined(step_result) ⇒ Object



186
187
188
189
# File 'lib/cucumber/core/test/runner.rb', line 186

def undefined(step_result)
  failed(step_result)
  self
end