class ScenarioContext
A class that holds useful debug information from a Scenario or Scenario Outline
A class that holds useful debug information from a Scenario or Scenario Outline
A class that holds useful debug information from a Scenario or Scenario Outline
Constants
- ScenarioProxy
A generic interface to a Scenario or ExampleRow
- VERSION
The version of the scenario_context gem
Attributes
@!attribute [r] scenario
@return [Scenario,ExampleRow]
Public Class Methods
# File lib/scenario_context.rb, line 10 def initialize(scenario) @scenario = ScenarioProxy.new(scenario) end
Public Instance Methods
@return [Boolean] true if the method is available or whether @scenario
responds to the method
# File lib/scenario_context.rb, line 31 def respond_to_missing?(method_name, include_private = false) super || scenario.respond_to?(method_name, include_private) || original_scenario.respond_to?(method_name, include_private) end
Sets @scenario as the scenario/outline wrapped in a proxy object
@param [Scenario,ExampleRow,ScenarioProxy] scenario the scenario to
set @scenario to
@return [ScenarioProxy] a scenario proxy object that holds the scenario or
scenario outline
# File lib/scenario_context.rb, line 20 def scenario=(scenario) @scenario = if scenario.is_a?(ScenarioProxy) scenario else ScenarioProxy.new(scenario) end end
Private Instance Methods
@raise [NoMethodError] if @scenario could not respond to the missing
method
@return the return value of the method after sending it to @scenario
# File lib/scenario_context.rb, line 40 def method_missing(method_name, *args, &block) if scenario.respond_to?(method_name) scenario.send(method_name, *args, &block) elsif original_scenario.respond_to?(method_name) original_scenario.send(method_name, *args, &block) else super end end
@return the native ExampleRow or Scenario object
# File lib/scenario_context.rb, line 51 def original_scenario scenario.scenario end