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



31
32
33
# File 'lib/maze/api/cucumber/scenario.rb', line 31

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

#locationObject



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

def location
  @scenario.location
end

#mark_as_failed(reason) ⇒ Object



26
27
28
29
# File 'lib/maze/api/cucumber/scenario.rb', line 26

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

#nameObject



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

def name
  @scenario.name
end

#tagsObject



22
23
24
# File 'lib/maze/api/cucumber/scenario.rb', line 22

def tags
  @scenario.tags
end