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