• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 25610530583
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: refactor/de-morgan-conditions
DEFAULT BRANCH: master
Ran 09 May 2026 08:03PM UTC
Jobs 37
Files 158
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 May 2026 08:02PM UTC coverage: 96.986% (+0.001%) from 96.985%
25610530583

Pull #2706

github

ericproulx
Make ParamsScope#validates pure via ValidationsSpec

`Grape::Validations::ParamsScope#validates(attrs, validations)` used
to consume the validations hash destructively across six helpers
(`infer_coercion`, `derive_validator_options`, `validates_presence`,
`coerce_type`, `document_params`, `extract_details`). The caller's
hash was mutated in place; passing a frozen hash would crash the
pipeline.

Introduces `Grape::Validations::ValidationsSpec` — a small frozen
value object that parses the raw hash once and exposes named
accessors. `validates` becomes a thin dispatcher that hands the spec
to the helpers; the raw hash is never written to. Helpers that used
to read/delete are gone:

  * `infer_coercion` → `ValidationsSpec#parse_coerce` (private)
  * `derive_validator_options` → `ValidationsSpec#shared_opts`
  * `validates_presence` → `ParamsScope#validate_presence(spec, ...)`
  * `coerce_type` (the helper) → `ParamsScope#validate_coerce(spec, ...)`
  * `guess_coerce_type` → `ValidationsSpec#guess_coerce_type` (private)
  * `options_key?` → no longer needed; `ValidationsSpec#resolve_value`

`ParamsDocumentation#document_params` now takes the spec instead of
the raw hash and reads via `spec.raw[...]` without deletion. The
`do_not_document` short-circuit no longer mutates either; it just
returns early.

Behaviour preserved:

  * Order of validator dispatch (presence → coerce → others).
  * `:message` belonging to presence is suppressed for later
    validators (it's in `SPEC_CONSUMED_KEYS`).
  * `:allow_blank` and `:length` remain dual-purpose (shared opt + own
    validator entry; doc source + own validator entry).
  * `check_coerce_with` still raises `ArgumentError` at definition
    time when `coerce_with:` is supplied without a type.

Adds:

  * `lib/grape/validations/validations_spec.rb` — value object.
  * `spec/grape/validations/validations_spec_spec.rb` — unit tests
    including a frozen-hash test that asserts `from(frozen_hash)` does
    not raise... (continued)
Pull Request #2706: Make ParamsScope#validates pure via ValidationsSpec (closes #2517)

1063 of 1147 branches covered (92.68%)

Branch coverage included in aggregate %.

87 of 87 new or added lines in 3 files covered. (100.0%)

3442 of 3498 relevant lines covered (98.4%)

32262.03 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rails_8_1.gemfile - 25610530583.1 09 May 2026 08:03PM UTC 158
95.67
GitHub Action Run
2 run-4.0-gemfiles/hashie.gemfile - 25610530583.2 09 May 2026 08:03PM UTC 157
62.95
GitHub Action Run
3 run-4.0-gemfiles/grape_entity.gemfile - 25610530583.3 09 May 2026 08:03PM UTC 157
50.22
GitHub Action Run
4 run-3.3-gemfiles/rack_2_2.gemfile - 25610530583.4 09 May 2026 08:03PM UTC 157
95.62
GitHub Action Run
5 run-4.0-gemfiles/rack_2_2.gemfile - 25610530583.5 09 May 2026 08:03PM UTC 157
95.64
GitHub Action Run
6 run-4.0-gemfiles/multi_xml.gemfile - 25610530583.6 09 May 2026 08:03PM UTC 157
36.28
GitHub Action Run
7 run-3.4-gemfiles/rack_3_1.gemfile - 25610530583.7 09 May 2026 08:03PM UTC 157
95.68
GitHub Action Run
8 run-4.0-gemfiles/rails_7_2.gemfile - 25610530583.8 09 May 2026 08:03PM UTC 158
95.69
GitHub Action Run
9 run-4.0-gemfiles/multi_json.gemfile - 25610530583.9 09 May 2026 08:03PM UTC 157
36.28
GitHub Action Run
10 run-3.3-gemfiles/rack_3_2.gemfile - 25610530583.10 09 May 2026 08:03PM UTC 157
95.66
GitHub Action Run
11 run-3.2-gemfiles/rack_3_0.gemfile - 25610530583.11 09 May 2026 08:03PM UTC 157
95.71
GitHub Action Run
12 run-3.4-gemfiles/rack_3_0.gemfile - 25610530583.12 09 May 2026 08:03PM UTC 157
95.68
GitHub Action Run
13 run-3.2-gemfiles/rack_2_2.gemfile - 25610530583.13 09 May 2026 08:03PM UTC 157
95.66
GitHub Action Run
14 run-3.3-gemfiles/rack_3_1.gemfile - 25610530583.14 09 May 2026 08:03PM UTC 157
95.66
GitHub Action Run
15 run-3.2-Gemfile - 25610530583.15 09 May 2026 08:03PM UTC 157
95.71
GitHub Action Run
16 run-4.0-gemfiles/rails_8_1.gemfile - 25610530583.16 09 May 2026 08:03PM UTC 158
95.69
GitHub Action Run
17 run-4.0-Gemfile - 25610530583.17 09 May 2026 08:03PM UTC 157
95.68
GitHub Action Run
18 run-3.3-gemfiles/rails_7_2.gemfile - 25610530583.18 09 May 2026 08:03PM UTC 158
95.67
GitHub Action Run
19 run-4.0-gemfiles/dry_validation.gemfile - 25610530583.19 09 May 2026 08:04PM UTC 157
58.37
GitHub Action Run
20 run-3.4-gemfiles/rack_3_2.gemfile - 25610530583.20 09 May 2026 08:03PM UTC 157
95.68
GitHub Action Run
21 run-4.0-gemfiles/rack_3_2.gemfile - 25610530583.21 09 May 2026 08:03PM UTC 157
95.68
GitHub Action Run
22 run-4.0-gemfiles/rails_8_0.gemfile - 25610530583.22 09 May 2026 08:03PM UTC 158
95.69
GitHub Action Run
23 run-3.2-gemfiles/rails_8_0.gemfile - 25610530583.23 09 May 2026 08:04PM UTC 158
95.71
GitHub Action Run
24 run-3.3-Gemfile - 25610530583.24 09 May 2026 08:03PM UTC 157
95.66
GitHub Action Run
25 run-3.4-Gemfile - 25610530583.25 09 May 2026 08:03PM UTC 157
95.68
GitHub Action Run
26 run-3.4-gemfiles/rack_2_2.gemfile - 25610530583.26 09 May 2026 08:03PM UTC 157
95.64
GitHub Action Run
27 run-4.0-gemfiles/rack_3_0.gemfile - 25610530583.27 09 May 2026 08:03PM UTC 157
95.68
GitHub Action Run
28 run-3.2-gemfiles/rack_3_2.gemfile - 25610530583.28 09 May 2026 08:03PM UTC 157
95.71
GitHub Action Run
29 run-3.4-gemfiles/rails_7_2.gemfile - 25610530583.29 09 May 2026 08:03PM UTC 158
95.69
GitHub Action Run
30 run-3.2-gemfiles/rails_7_2.gemfile - 25610530583.30 09 May 2026 08:03PM UTC 158
95.71
GitHub Action Run
31 run-3.3-gemfiles/rails_8_0.gemfile - 25610530583.31 09 May 2026 08:03PM UTC 158
95.67
GitHub Action Run
32 run-3.3-gemfiles/rack_3_0.gemfile - 25610530583.32 09 May 2026 08:03PM UTC 157
95.66
GitHub Action Run
33 run-3.2-gemfiles/rack_3_1.gemfile - 25610530583.33 09 May 2026 08:03PM UTC 157
95.71
GitHub Action Run
34 run-3.4-gemfiles/rails_8_0.gemfile - 25610530583.34 09 May 2026 08:03PM UTC 158
95.69
GitHub Action Run
35 run-3.4-gemfiles/rails_8_1.gemfile - 25610530583.35 09 May 2026 08:03PM UTC 158
95.69
GitHub Action Run
36 run-3.2-gemfiles/rails_8_1.gemfile - 25610530583.36 09 May 2026 08:03PM UTC 158
95.71
GitHub Action Run
37 run-4.0-gemfiles/rack_3_1.gemfile - 25610530583.37 09 May 2026 08:03PM UTC 157
95.68
GitHub Action Run
Source Files on build 25610530583
  • Tree
  • List 158
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25610530583
  • Pull Request #2706
  • PR Base - master (#25608800647)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc