|
1 | 1 | module Pact
|
2 | 2 | module Provider
|
3 | 3 | module PactHelperLocater
|
4 |
| - PACT_HELPER_FILE_PATTERNS = [ |
| 4 | + PACT_HELPER_FILE_PATTERNS = [ |
5 | 5 | "spec/**/*service*consumer*/pact_helper.rb",
|
6 | 6 | "spec/**/*consumer*/pact_helper.rb",
|
7 | 7 | "spec/**/pact_helper.rb",
|
8 |
| - "**/pact_helper.rb"] |
| 8 | + "test/**/*service*consumer*/pact_helper.rb", |
| 9 | + "test/**/*consumer*/pact_helper.rb", |
| 10 | + "test/**/pact_helper.rb", |
| 11 | + "**/pact_helper.rb" |
| 12 | + ] |
9 | 13 |
|
10 |
| - 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(", ")}" |
11 |
| - |
12 |
| - def self.pact_helper_path |
13 |
| - pact_helper_search_results = [] |
14 |
| - PACT_HELPER_FILE_PATTERNS.find { | pattern | (pact_helper_search_results.concat(Dir.glob(pattern))).any? } |
15 |
| - raise NO_PACT_HELPER_FOUND_MSG if pact_helper_search_results.empty? |
16 |
| - File.join(Dir.pwd, pact_helper_search_results[0]) |
17 |
| - end |
| 14 | + 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(", ")}" |
18 | 15 |
|
| 16 | + def self.pact_helper_path |
| 17 | + pact_helper_search_results = [] |
| 18 | + PACT_HELPER_FILE_PATTERNS.find { | pattern | (pact_helper_search_results.concat(Dir.glob(pattern))).any? } |
| 19 | + raise NO_PACT_HELPER_FOUND_MSG if pact_helper_search_results.empty? |
| 20 | + File.join(Dir.pwd, pact_helper_search_results[0]) |
| 21 | + end |
19 | 22 | end
|
20 | 23 | end
|
21 | 24 | end
|
|
0 commit comments