Class: Maze::Api::Cucumber::Scenario

Inherits:
Object
  • Object
show all
Defined in:
lib/maze/api/cucumber/scenario.rb

Overview

An abstraction for the underlying Cucumber scenarios

Instance Method Summary collapse

Constructor Details

#initialize(scenario) ⇒ Scenario

Returns a new instance of Scenario.

Parameters:

  • scenario

    The underlying Cucumber scenario



8
9
10
11
12
# File 'lib/maze/api/cucumber/scenario.rb', line 8

def initialize(scenario)
  @scenario = scenario
  @fail_override = false
  @fail_override_reason = nil
end

Instance Method Details

#completeObject



19
20
21
# File 'lib/maze/api/cucumber/scenario.rb', line 19

def complete
  @scenario.fail(@fail_override_reason) if @fail_override
end

#mark_as_failed(reason) ⇒ Object



14
15
16
17
# File 'lib/maze/api/cucumber/scenario.rb', line 14

def mark_as_failed(reason)
  @fail_override = true
  @fail_override_reason = reason
end