Commit f66a0d7
authored
Fix test suite compatibility with Grape 4.0 (grape=HEAD CI) (#982)
The grape=HEAD canary CI job tracks Grape's development branch to catch
breaking changes before they land in a release. It started failing
because Grape 4.0 changed three internal constructor signatures that
the test helpers rely on:
- Grape::Router::Pattern.new dropped the format: keyword
- Grape::Router::Route.new promoted forward_match from an options-hash
entry to a required keyword argument
- Grape::Endpoint.new replaced method:/for: with http_methods:/api:
Add a GrapeVersion.satisfy?('>= 4.0.0') branch in
spec/support/route_helper.rb and spec/lib/endpoint_spec.rb to use the
new call shapes against Grape HEAD while leaving existing behavior
untouched for the supported pinned range (2.1–3.x).1 parent 76dd115 commit f66a0d7
3 files changed
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
6 | 16 | | |
7 | 17 | | |
8 | 18 | | |
| |||
0 commit comments