Class: Pact::ProviderVerifier::SetUpProviderState

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/provider_verifier/set_up_provider_state.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider_state, consumer, options) ⇒ SetUpProviderState

Returns a new instance of SetUpProviderState.



10
11
12
13
14
# File 'lib/pact/provider_verifier/set_up_provider_state.rb', line 10

def initialize provider_state, consumer, options
  @provider_state = provider_state
  @consumer = consumer
  @options = options
end

Class Method Details

.call(provider_state, consumer, options) ⇒ Object



16
17
18
# File 'lib/pact/provider_verifier/set_up_provider_state.rb', line 16

def self.call provider_state, consumer, options
  new(provider_state, consumer, options).call
end

Instance Method Details

#callObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/pact/provider_verifier/set_up_provider_state.rb', line 20

def call
  if provider_states_setup_url.nil?
    warn_if_provider_state_set
    return
  end

  log_request
  response = post_to_provider_state
  check_for_error response
end