Sha256: b1f4c8f6484a3cd7602e7145d85c22a02b9516748d084336e3062ea2bbef3c92

Contents?: true

Size: 787 Bytes

Versions: 38

Compression:

Stored size: 787 Bytes

Contents

module Pact
  module Provider
    module PactHelperLocater
        PACT_HELPER_FILE_PATTERNS = [
        "spec/**/*service*consumer*/pact_helper.rb",
        "spec/**/*consumer*/pact_helper.rb",
        "spec/**/pact_helper.rb",
        "**/pact_helper.rb"]

        NO_PACT_HELPER_FOUND_MSG = "Please create a pact_helper.rb file that can be found using one of the following patterns: #{PACT_HELPER_FILE_PATTERNS.join(", ")}"

        def self.pact_helper_path
          pact_helper_search_results = []
          PACT_HELPER_FILE_PATTERNS.find { | pattern | (pact_helper_search_results.concat(Dir.glob(pattern))).any? }
          raise NO_PACT_HELPER_FOUND_MSG if pact_helper_search_results.empty?
          "#{Dir.pwd}/#{pact_helper_search_results[0]}"
        end

    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
pact-1.1.1 lib/pact/provider/pact_helper_locator.rb
pact-1.1.0 lib/pact/provider/pact_helper_locator.rb
pact-1.1.0.rc5 lib/pact/provider/pact_helper_locator.rb
pact-1.1.0.rc4 lib/pact/provider/pact_helper_locator.rb
pact-1.1.0.rc3 lib/pact/provider/pact_helper_locator.rb
pact-1.0.39 lib/pact/provider/pact_helper_locator.rb
pact-1.1.0.rc2 lib/pact/provider/pact_helper_locator.rb
pact-1.0.38 lib/pact/provider/pact_helper_locator.rb
pact-1.1.0.rc1 lib/pact/provider/pact_helper_locator.rb
pact-1.0.37 lib/pact/provider/pact_helper_locator.rb
pact-1.0.36 lib/pact/provider/pact_helper_locator.rb
pact-1.0.35 lib/pact/provider/pact_helper_locator.rb
pact-1.0.34 lib/pact/provider/pact_helper_locator.rb
pact-1.0.33 lib/pact/provider/pact_helper_locator.rb
pact-1.0.32 lib/pact/provider/pact_helper_locator.rb
pact-1.0.31 lib/pact/provider/pact_helper_locator.rb
pact-1.0.30 lib/pact/provider/pact_helper_locator.rb
pact-1.0.29 lib/pact/provider/pact_helper_locator.rb
pact-1.0.28 lib/pact/provider/pact_helper_locator.rb
pact-1.0.27 lib/pact/provider/pact_helper_locator.rb