class Pact::Message::Consumer::InteractionBuilder

Attributes

interaction[R]

Public Class Methods

new(&block) click to toggle source
# File lib/pact/message/consumer/interaction_builder.rb, line 10
def initialize &block
  @interaction = Pact::Message.new
  @callback = block
end

Public Instance Methods

and(name, params = {})
Alias for: given
given(name, params = {}) click to toggle source
# File lib/pact/message/consumer/interaction_builder.rb, line 20
def given name, params = {}
  if name
    @interaction.provider_states << Pact::ProviderState.new(name, params)
  end
  self
end
Also aliased as: and
is_expected_to_send(description) click to toggle source
# File lib/pact/message/consumer/interaction_builder.rb, line 15
def is_expected_to_send description
  @interaction.description = description
  self
end
with_content(object) click to toggle source
# File lib/pact/message/consumer/interaction_builder.rb, line 34
def with_content(object)
  interaction.contents = Pact::Message::Contents.from_hash(object)
  @callback.call interaction
  self
end
with_metadata(object) click to toggle source
# File lib/pact/message/consumer/interaction_builder.rb, line 29
def with_metadata(object)
  interaction.metadata = object
  self
end