Sha256: d39700e0fcb0a6a3092158d2fe4d50e49efe353fd98da6a322a34e879f03d8ca

Contents?: true

Size: 1.04 KB

Versions: 14

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'
require 'pact/provider/configuration'

module Pact::Provider::Configuration

  describe ConfigurationExtension do

    before do
      Pact.clear_configuration
    end

    describe "service_provider" do

      context "when a provider is configured" do

        before do
          Pact.service_provider "Fred" do
            app { "An app" }
          end
        end

        it "should allow configuration of the test app" do
          expect(Pact.configuration.provider.app).to eql "An app"
        end

      end

      context "when a provider is not configured" do

        it "raises an error" do
          expect{ Pact.configuration.provider }.to raise_error(/Please configure your provider/)
        end

      end

      context "when a provider is configured without an app" do

        before do
          Pact.service_provider "Fred" do
          end
        end

        it "uses the app from config.ru" do
          expect( Pact.configuration.provider.app ).to be(AppForConfigRu)
        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
pact-1.4.0.rc4 spec/lib/pact/provider/configuration_spec.rb
pact-1.4.0.rc3 spec/lib/pact/provider/configuration_spec.rb
pact-1.4.0.rc2 spec/lib/pact/provider/configuration_spec.rb
pact-1.3.3 spec/lib/pact/provider/configuration_spec.rb
pact-1.3.2 spec/lib/pact/provider/configuration_spec.rb
pact-1.3.1 spec/lib/pact/provider/configuration_spec.rb
pact-1.3.0 spec/lib/pact/provider/configuration_spec.rb
pact-1.2.1.rc2 spec/lib/pact/provider/configuration_spec.rb
pact-1.2.1.rc1 spec/lib/pact/provider/configuration_spec.rb
pact-1.1.1 spec/lib/pact/provider/configuration_spec.rb
pact-1.1.0 spec/lib/pact/provider/configuration_spec.rb
pact-1.1.0.rc5 spec/lib/pact/provider/configuration_spec.rb
pact-1.1.0.rc4 spec/lib/pact/provider/configuration_spec.rb
pact-1.1.0.rc3 spec/lib/pact/provider/configuration_spec.rb