Module: Pact::Provider::RSpec::ClassMethods

Includes:
RSpec::Core::DSL
Included in:
PactSpecRunner
Defined in:
lib/pact/provider/rspec.rb

Instance Method Summary collapse

Instance Method Details

#honour_consumer_contract(consumer_contract, options = {}) ⇒ Object



31
32
33
# File 'lib/pact/provider/rspec.rb', line 31

def honour_consumer_contract consumer_contract, options = {}
  describe_consumer_contract consumer_contract, options.merge({:consumer => consumer_contract.consumer.name})
end

#honour_pactfile(pactfile_uri, options = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/pact/provider/rspec.rb', line 21

def honour_pactfile pactfile_uri, options = {}
  puts "Filtering specs by: #{options[:criteria]}" if options[:criteria]
  consumer_contract = Pact::ConsumerContract.from_json(read_pact_from(pactfile_uri, options))
  describe "A pact between #{consumer_contract.consumer.name} and #{consumer_contract.provider.name}" do
    describe "in #{pactfile_uri}" do
      honour_consumer_contract consumer_contract, options
    end
  end
end