Sha256: 0b383c61cee1997c352e8d3bd865cd729ba748c6562eb391123ccaea8adbe17c

Contents?: true

Size: 1.32 KB

Versions: 18

Compression:

Stored size: 1.32 KB

Contents

require 'pact/consumer'

module Pact
  module Consumer
    module RSpec
      include Pact::Consumer::ConsumerContractBuilders
    end
  end
end

RSpec.configure do |config|
  config.include Pact::Consumer::RSpec, :pact => true

  config.before :all, :pact => true do
    Pact::Consumer::AppManager.instance.spawn_all
    FileUtils.mkdir_p Pact.configuration.pact_dir
  end

  config.before :each, :pact => true do | example |
    example_description = "#{example.example.example_group.description} #{example.example.description}"
    Pact.configuration.logger.info "Clearing all expectations"
    Pact::Consumer::AppManager.instance.ports_of_mock_services.each do | port |
      Pact::Consumer::MockServiceClient.clear_interactions port, example_description
    end
  end

  config.after :each, :pact => true do | example |
    example_description = "#{example.example.example_group.description} #{example.example.description}"
    Pact.configuration.logger.info "Verifying interactions for #{example_description}"
    Pact.configuration.provider_verifications.each do | provider_verification |
      provider_verification.call example_description
    end
  end

  config.after :suite do
    Pact.configuration.logger.info "After suite"
    Pact::Consumer::AppManager.instance.kill_all
    Pact::Consumer::AppManager.instance.clear_all
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pact-1.0.30 lib/pact/consumer/rspec.rb
pact-1.0.29 lib/pact/consumer/rspec.rb
pact-1.0.28 lib/pact/consumer/rspec.rb
pact-1.0.27 lib/pact/consumer/rspec.rb
pact-1.0.26 lib/pact/consumer/rspec.rb
pact-1.0.25 lib/pact/consumer/rspec.rb
pact-1.0.24 lib/pact/consumer/rspec.rb
pact-1.0.23 lib/pact/consumer/rspec.rb
pact-1.0.22 lib/pact/consumer/rspec.rb
pact-1.0.21 lib/pact/consumer/rspec.rb
pact-1.0.20 lib/pact/consumer/rspec.rb
pact-1.0.19 lib/pact/consumer/rspec.rb
pact-1.0.18 lib/pact/consumer/rspec.rb
pact-1.0.15 lib/pact/consumer/rspec.rb
pact-1.0.13 lib/pact/consumer/rspec.rb
pact-1.0.12 lib/pact/consumer/rspec.rb
pact-1.0.11 lib/pact/consumer/rspec.rb
pact-1.0.10 lib/pact/consumer/rspec.rb