Sha256: 85862894aad036a3ebff85727f2f30a28f636849804354c0ef1358c81a553ae3

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require "blood_contracts/version"

require_relative "extensions/string.rb"
require "dry-initializer"
require "hashie/mash"

require_relative "blood_contracts/suite"
require_relative "blood_contracts/storage"
require_relative "blood_contracts/statistics"
require_relative "blood_contracts/runner"
require_relative "blood_contracts/debugger"
require_relative "blood_contracts/base_contract"

module BloodContracts
  def run_name
    @__contracts_run_name
  end
  module_function :run_name

  def run_name=(run_name)
    @__contracts_run_name = run_name
  end
  module_function :run_name=

  if defined?(RSpec) && RSpec.respond_to?(:configure)
    require_relative "rspec/meet_contract_matcher"

    RSpec.configure do |config|
      config.include ::RSpec::MeetContractMatcher
      config.filter_run_excluding contract: true
      config.before(:suite) do
        BloodContracts.run_name = ::Nanoid.generate(size: 10)
      end
      config.define_derived_metadata(file_path: %r{/spec/contracts/}) do |meta|
        meta[:contract] = true
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blood_contracts-0.2.0 lib/blood_contracts.rb