Sha256: a34f569d2a7ace42824d7e9037cb983a07fcfc1027d72f290865e0fe7e88c03d

Contents?: true

Size: 1001 Bytes

Versions: 11

Compression:

Stored size: 1001 Bytes

Contents

module Pact
  module Consumer
    class SpecHooks

      def before_all
        Pact::Consumer::AppManager.instance.spawn_all
        FileUtils.mkdir_p Pact.configuration.pact_dir
      end

      def before_each 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

      def after_each 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

      def after_suite
        Pact.configuration.logger.info "After suite"
        Pact::Consumer::AppManager.instance.kill_all
        Pact::Consumer::AppManager.instance.clear_all
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pact-1.0.39 lib/pact/consumer/spec_hooks.rb
pact-1.1.0.rc2 lib/pact/consumer/spec_hooks.rb
pact-1.0.38 lib/pact/consumer/spec_hooks.rb
pact-1.1.0.rc1 lib/pact/consumer/spec_hooks.rb
pact-1.0.37 lib/pact/consumer/spec_hooks.rb
pact-1.0.36 lib/pact/consumer/spec_hooks.rb
pact-1.0.35 lib/pact/consumer/spec_hooks.rb
pact-1.0.34 lib/pact/consumer/spec_hooks.rb
pact-1.0.33 lib/pact/consumer/spec_hooks.rb
pact-1.0.32 lib/pact/consumer/spec_hooks.rb
pact-1.0.31 lib/pact/consumer/spec_hooks.rb