Sha256: 7da675cad1051f00c083bcc1ec87ef669dc049d80b4b403bb2fde0d769227197

Contents?: true

Size: 791 Bytes

Versions: 65

Compression:

Stored size: 791 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?
          File.join(Dir.pwd, pact_helper_search_results[0])
        end

    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
pact-1.41.1 lib/pact/provider/pact_helper_locator.rb
pact-1.41.0 lib/pact/provider/pact_helper_locator.rb
pact-1.40.0 lib/pact/provider/pact_helper_locator.rb
pact-1.39.0 lib/pact/provider/pact_helper_locator.rb
pact-1.38.0 lib/pact/provider/pact_helper_locator.rb
pact-1.37.0 lib/pact/provider/pact_helper_locator.rb
pact-1.36.2 lib/pact/provider/pact_helper_locator.rb
pact-1.36.0 lib/pact/provider/pact_helper_locator.rb
pact-1.34.0 lib/pact/provider/pact_helper_locator.rb
pact-1.33.2 lib/pact/provider/pact_helper_locator.rb
pact-1.33.1 lib/pact/provider/pact_helper_locator.rb
pact-1.33.0 lib/pact/provider/pact_helper_locator.rb
pact-1.32.0 lib/pact/provider/pact_helper_locator.rb
pact-1.31.0 lib/pact/provider/pact_helper_locator.rb
pact-1.30.0 lib/pact/provider/pact_helper_locator.rb
pact-1.29.0 lib/pact/provider/pact_helper_locator.rb
pact-1.28.0 lib/pact/provider/pact_helper_locator.rb
pact-1.28.0.rc1 lib/pact/provider/pact_helper_locator.rb
pact-1.27.0 lib/pact/provider/pact_helper_locator.rb
pact-1.26.0 lib/pact/provider/pact_helper_locator.rb