Skip to content

Commit 0186680

Browse files
authored
Merge pull request #333 from pact-foundation/cuon-kakimoto-fix/sinatra_4_1_x_host
Cuon kakimoto fix/sinatra 4 1 x host
2 parents add2922 + 1b1a8bf commit 0186680

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ jobs:
1717
matrix:
1818
ruby_version: ["2.7", "3.0", "3.1", "3.2", "3.3"]
1919
os: ["ubuntu-latest","windows-latest","macos-latest"]
20-
# defaults:
21-
# run:
22-
# shell: bash
2320
steps:
2421
- uses: actions/checkout@v4
2522
- uses: ruby/setup-ruby@v1
2623
with:
2724
ruby-version: ${{ matrix.ruby_version }}
2825
bundler-cache: true
2926
- run: "bundle exec rake"
27+
- run: "bundle install && bundle exec rake spec"
28+
if: matrix.ruby_version > '3.0'
29+
working-directory: example/zoo-app
30+
- run: "bundle install && bundle exec rake pact:verify"
31+
if: matrix.os != 'windows-latest' && matrix.ruby_version > '3.0'
32+
working-directory: example/animal-service
3033
test-with-rack-2:
3134
runs-on: ${{ matrix.os }}
3235
strategy:
@@ -59,4 +62,4 @@ jobs:
5962
ruby-version: ${{ matrix.ruby_version }}
6063
bundler-cache: true
6164
- run: "bundle exec appraisal install"
62-
- run: "bundle exec appraisal activesupport rake spec_with_active_support"
65+
- run: "bundle exec appraisal activesupport rake spec_with_active_support"

example/animal-service/Gemfile.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
PATH
22
remote: ../..
33
specs:
4-
pact (1.65.3)
4+
pact (1.66.0)
5+
jsonpath (~> 1.0)
56
pact-mock_service (~> 3.0, >= 3.3.1)
6-
pact-support (~> 1.16, >= 1.16.9)
7+
pact-support (~> 1.19, >= 1.19.0)
78
rack-test (>= 0.6.3, < 3.0.0)
89
rainbow (~> 3.1)
910
rspec (~> 3.0)
11+
string_pattern (~> 2.0)
1012
thor (>= 0.20, < 2.0)
1113

1214
GEM
@@ -104,7 +106,7 @@ DEPENDENCIES
104106
rake
105107
rspec
106108
sequel
107-
sinatra (>= 4.0.0)
109+
sinatra (>= 4.1.0)
108110
sqlite3
109111

110112
BUNDLED WITH

example/zoo-app/Gemfile.lock

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
PATH
22
remote: ../..
33
specs:
4-
pact (1.65.3)
4+
pact (1.66.0)
5+
jsonpath (~> 1.0)
56
pact-mock_service (~> 3.0, >= 3.3.1)
6-
pact-support (~> 1.16, >= 1.16.9)
7+
pact-support (~> 1.19, >= 1.19.0)
78
rack-test (>= 0.6.3, < 3.0.0)
89
rainbow (~> 3.1)
910
rspec (~> 3.0)
11+
string_pattern (~> 2.0)
1012
thor (>= 0.20, < 2.0)
1113

1214
GEM
@@ -27,8 +29,11 @@ GEM
2729
mini_mime (>= 1.0.0)
2830
multi_xml (>= 0.5.2)
2931
json (2.8.2)
32+
jsonpath (1.1.5)
33+
multi_json
3034
method_source (1.1.0)
3135
mini_mime (1.1.5)
36+
multi_json (1.15.0)
3237
multi_xml (0.7.1)
3338
bigdecimal (~> 3.1)
3439
ostruct (0.6.1)
@@ -66,6 +71,7 @@ GEM
6671
rack (>= 3)
6772
rainbow (3.1.1)
6873
rake (13.2.1)
74+
regexp_parser (2.10.0)
6975
rspec (3.13.0)
7076
rspec-core (~> 3.13.0)
7177
rspec-expectations (~> 3.13.0)
@@ -79,6 +85,8 @@ GEM
7985
diff-lcs (>= 1.2.0, < 2.0)
8086
rspec-support (~> 3.13.0)
8187
rspec-support (3.13.1)
88+
string_pattern (2.3.0)
89+
regexp_parser (~> 2.5, >= 2.5.0)
8290
sync (0.5.0)
8391
table_print (1.5.7)
8492
term-ansicolor (1.11.2)

lib/pact/provider/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def body
3535

3636
def headers
3737
request_headers = {}
38-
request_headers.merge!('HTTP_HOST' => 'localhost') if defined?(Sinatra)
38+
request_headers.merge!('HOST' => 'localhost') if defined?(Sinatra)
3939
return request_headers if expected_request.headers.is_a?(Pact::NullExpectation)
4040

4141
expected_request.headers.each do |key, value|

0 commit comments

Comments
 (0)