module Pact::Provider::PactHelperLocater

Constants

NO_PACT_HELPER_FOUND_MSG
PACT_HELPER_FILE_PATTERNS

Public Class Methods

pact_helper_path() click to toggle source
# File lib/pact/provider/pact_helper_locator.rb, line 16
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