Sha256: f21a90f2c02e2988638c0019c8a889d2f517ece60f8e6d1b0db58a12378139fd

Contents?: true

Size: 922 Bytes

Versions: 15

Compression:

Stored size: 922 Bytes

Contents

require 'spec_helper'
require 'pact/configuration'

describe Pact do

  before do
    Pact.clear_configuration
  end

  describe "configure" do
    KEY_VALUE_PAIRS = {pact_dir: 'a path', log_dir: 'a dir', logger: 'a logger'}

    KEY_VALUE_PAIRS.each do | key, value |
      it "should allow configuration of #{key}" do
        Pact.configure do | config |
          config.send("#{key}=".to_sym, value)
        end

        expect(Pact.configuration.send(key)).to eql(value)
      end
    end
  end

  describe "configuration" do
    it "should have a default pact_dir" do
      expect(Pact.configuration.pact_dir).to eql File.expand_path('./spec/pacts')
    end
    it "should have a default log_dir" do
      expect(Pact.configuration.log_dir).to eql File.expand_path('./log')
    end
    it "should have a default logger configured" do
      expect(Pact.configuration.logger).to be_instance_of Logger
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
pact-1.0.11 spec/lib/pact/configuration_spec.rb
pact-1.0.10 spec/lib/pact/configuration_spec.rb
pact-1.0.9 spec/lib/pact/configuration_spec.rb
pact-1.0.8 spec/lib/pact/configuration_spec.rb
pact-1.0.7 spec/lib/pact/configuration_spec.rb
pact-1.0.6 spec/lib/pact/configuration_spec.rb
pact-1.0.5 spec/lib/pact/configuration_spec.rb
pact-1.0.4 spec/lib/pact/configuration_spec.rb
pact-1.0.3 spec/lib/pact/configuration_spec.rb
pact-1.0.2 spec/lib/pact/configuration_spec.rb
pact-1.0.1 spec/lib/pact/configuration_spec.rb
pact-1.0.0 spec/lib/pact/configuration_spec.rb
pact-0.1.37 spec/lib/pact/configuration_spec.rb
pact-0.1.35 spec/lib/pact/configuration_spec.rb
pact-0.1.28 spec/lib/pact/configuration_spec.rb