Sha256: 9732f9f57e54ef4dd96686dbd7252ea1187f54362a0b0319915b44e2af618a1a

Contents?: true

Size: 1.31 KB

Versions: 25

Compression:

Stored size: 1.31 KB

Contents

require 'webmock/rspec'
require 'rspec/its'

WebMock.disable_net_connect!(allow_localhost: true)

require "./spec/support/shared_context.rb"
require "./spec/support/approvals.rb"

is_windows = (RbConfig::CONFIG['host_os'] =~ /bccwin|cygwin|djgpp|mingw|mswin|wince/i) != nil
is_ci = ENV['CI'] == 'true'

RSpec.configure do | config |

  config.before(:each) do
    ENV.delete('PACT_BROKER_BASE_URL')
    ENV.delete('PACT_BROKER_USERNAME')
    ENV.delete('PACT_BROKER_PASSWORD')
    ENV.delete('PACT_BROKER_TOKEN')
  end

  config.after(:all) do
    Pact::Fixture.check_fixtures
  end

  config.filter_run_excluding skip_windows: is_windows, skip_ci: is_ci
  config.example_status_persistence_file_path = "./spec/examples.txt"

  def capture(stream)
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      yield
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end

    result
  end
end

module Pact
  module Fixture

    def self.add_fixture key, value
      fixtures[key] ||= []
      fixtures[key] << value
    end

    def self.fixtures
      @fixtures ||= {}
    end

    def self.check_fixtures
      fixtures.each do | fixture_group |
        if fixture_group.size > 1
          #TODO compare fixtures to ensure they match
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pact_broker-client-1.65.0 spec/spec_helper.rb
pact_broker-client-1.64.0 spec/spec_helper.rb
pact_broker-client-1.63.0 spec/spec_helper.rb
pact_broker-client-1.62.1 spec/spec_helper.rb
pact_broker-client-1.62.0 spec/spec_helper.rb
pact_broker-client-1.61.1 spec/spec_helper.rb
pact_broker-client-1.61.0 spec/spec_helper.rb
pact_broker-client-1.60.0 spec/spec_helper.rb
pact_broker-client-1.59.0 spec/spec_helper.rb
pact_broker-client-1.58.0 spec/spec_helper.rb
pact_broker-client-1.57.0 spec/spec_helper.rb
pact_broker-client-1.56.0 spec/spec_helper.rb
pact_broker-client-1.55.0 spec/spec_helper.rb
pact_broker-client-1.54.0 spec/spec_helper.rb
pact_broker-client-1.53.0 spec/spec_helper.rb
pact_broker-client-1.52.0 spec/spec_helper.rb
pact_broker-client-1.51.2 spec/spec_helper.rb
pact_broker-client-1.51.1 spec/spec_helper.rb
pact_broker-client-1.51.0 spec/spec_helper.rb
pact_broker-client-1.50.0 spec/spec_helper.rb