class WireMockMapper::Builders::ScenarioBuilder

Public Class Methods

new() click to toggle source

Scenarios allow for stateful behavior

# File lib/builders/scenario_builder.rb, line 6
def initialize
  @options = {}
end

Public Instance Methods

in_scenario(scenario) click to toggle source
# File lib/builders/scenario_builder.rb, line 10
def in_scenario(scenario)
  @options[:scenarioName] = scenario
  self
end
to_hash(*) click to toggle source
# File lib/builders/scenario_builder.rb, line 25
def to_hash(*)
  options_with_url_match = @options.merge(@url_match.to_hash) if @url_match
  options_with_url_match || @options
end
to_json(*) click to toggle source
# File lib/builders/scenario_builder.rb, line 30
def to_json(*)
  to_hash.to_json
end
will_set_state(state) click to toggle source
# File lib/builders/scenario_builder.rb, line 20
def will_set_state(state)
  @options[:newScenarioState] = state
  self
end
with_state(state) click to toggle source
# File lib/builders/scenario_builder.rb, line 15
def with_state(state)
  @options[:requiredScenarioState] = state
  self
end