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

ruby-grape / grape / 25718782466
97%

Build:
DEFAULT BRANCH: master
Ran 12 May 2026 07:00AM UTC
Jobs 37
Files 159
Run time 2min
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

12 May 2026 06:58AM UTC coverage: 97.039% (+0.001%) from 97.038%
25718782466

push

github

web-flow
Make ParamsScope#validates pure via ValidationsSpec (#2706)

`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
    n... (continued)

1076 of 1159 branches covered (92.84%)

Branch coverage included in aggregate %.

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

3479 of 3535 relevant lines covered (98.42%)

32080.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.3-gemfiles/rack_3_2.gemfile - 25718782466.1 12 May 2026 07:00AM UTC 158
95.73
GitHub Action Run
2 run-3.2-Gemfile - 25718782466.2 12 May 2026 07:01AM UTC 158
95.77
GitHub Action Run
3 run-3.4-gemfiles/rails_7_2.gemfile - 25718782466.3 12 May 2026 07:02AM UTC 159
95.75
GitHub Action Run
4 run-4.0-gemfiles/multi_xml.gemfile - 25718782466.4 12 May 2026 07:03AM UTC 158
36.15
GitHub Action Run
5 run-4.0-gemfiles/rails_7_2.gemfile - 25718782466.5 12 May 2026 07:02AM UTC 159
95.75
GitHub Action Run
6 run-4.0-gemfiles/rails_8_1.gemfile - 25718782466.6 12 May 2026 07:04AM UTC 159
95.75
GitHub Action Run
7 run-3.3-gemfiles/rack_3_0.gemfile - 25718782466.7 12 May 2026 07:01AM UTC 158
95.73
GitHub Action Run
8 run-4.0-gemfiles/rack_3_2.gemfile - 25718782466.8 12 May 2026 07:02AM UTC 158
95.75
GitHub Action Run
9 run-3.4-gemfiles/rack_3_0.gemfile - 25718782466.9 12 May 2026 07:03AM UTC 158
95.75
GitHub Action Run
10 run-3.4-gemfiles/rack_3_2.gemfile - 25718782466.10 12 May 2026 07:02AM UTC 158
95.75
GitHub Action Run
11 run-4.0-Gemfile - 25718782466.11 12 May 2026 07:03AM UTC 158
95.75
GitHub Action Run
12 run-3.3-gemfiles/rack_2_2.gemfile - 25718782466.12 12 May 2026 07:01AM UTC 158
95.69
GitHub Action Run
13 run-4.0-gemfiles/rack_3_0.gemfile - 25718782466.13 12 May 2026 07:02AM UTC 158
95.75
GitHub Action Run
14 run-4.0-gemfiles/rails_8_0.gemfile - 25718782466.14 12 May 2026 07:03AM UTC 159
95.75
GitHub Action Run
15 run-4.0-gemfiles/multi_json.gemfile - 25718782466.15 12 May 2026 07:03AM UTC 158
36.15
GitHub Action Run
16 run-3.2-gemfiles/rack_2_2.gemfile - 25718782466.16 12 May 2026 07:02AM UTC 158
95.73
GitHub Action Run
17 run-3.2-gemfiles/rack_3_0.gemfile - 25718782466.17 12 May 2026 07:01AM UTC 158
95.77
GitHub Action Run
18 run-3.4-gemfiles/rails_8_1.gemfile - 25718782466.18 12 May 2026 07:02AM UTC 159
95.75
GitHub Action Run
19 run-3.3-gemfiles/rails_7_2.gemfile - 25718782466.19 12 May 2026 07:01AM UTC 159
95.73
GitHub Action Run
20 run-3.4-Gemfile - 25718782466.20 12 May 2026 07:01AM UTC 158
95.75
GitHub Action Run
21 run-4.0-gemfiles/hashie.gemfile - 25718782466.21 12 May 2026 07:02AM UTC 158
62.65
GitHub Action Run
22 run-3.3-gemfiles/rails_8_1.gemfile - 25718782466.22 12 May 2026 07:00AM UTC 159
95.73
GitHub Action Run
23 run-4.0-gemfiles/rack_2_2.gemfile - 25718782466.23 12 May 2026 07:03AM UTC 158
95.71
GitHub Action Run
24 run-3.2-gemfiles/rails_8_0.gemfile - 25718782466.24 12 May 2026 07:01AM UTC 159
95.78
GitHub Action Run
25 run-3.4-gemfiles/rails_8_0.gemfile - 25718782466.25 12 May 2026 07:03AM UTC 159
95.75
GitHub Action Run
26 run-3.2-gemfiles/rack_3_1.gemfile - 25718782466.26 12 May 2026 07:02AM UTC 158
95.77
GitHub Action Run
27 run-3.4-gemfiles/rack_2_2.gemfile - 25718782466.27 12 May 2026 07:00AM UTC 158
95.71
GitHub Action Run
28 run-4.0-gemfiles/dry_validation.gemfile - 25718782466.28 12 May 2026 07:03AM UTC 158
58.13
GitHub Action Run
29 run-3.3-Gemfile - 25718782466.29 12 May 2026 07:02AM UTC 158
95.73
GitHub Action Run
30 run-3.2-gemfiles/rails_8_1.gemfile - 25718782466.30 12 May 2026 07:02AM UTC 159
95.78
GitHub Action Run
31 run-3.2-gemfiles/rails_7_2.gemfile - 25718782466.31 12 May 2026 07:01AM UTC 159
95.78
GitHub Action Run
32 run-3.3-gemfiles/rails_8_0.gemfile - 25718782466.32 12 May 2026 07:02AM UTC 159
95.73
GitHub Action Run
33 run-4.0-gemfiles/grape_entity.gemfile - 25718782466.33 12 May 2026 07:01AM UTC 158
50.03
GitHub Action Run
34 run-3.3-gemfiles/rack_3_1.gemfile - 25718782466.34 12 May 2026 07:01AM UTC 158
95.73
GitHub Action Run
35 run-3.2-gemfiles/rack_3_2.gemfile - 25718782466.35 12 May 2026 07:02AM UTC 158
95.77
GitHub Action Run
36 run-4.0-gemfiles/rack_3_1.gemfile - 25718782466.36 12 May 2026 07:02AM UTC 158
95.75
GitHub Action Run
37 run-3.4-gemfiles/rack_3_1.gemfile - 25718782466.37 12 May 2026 07:04AM UTC 158
95.75
GitHub Action Run
Source Files on build 25718782466
  • Tree
  • List 159
  • 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 #25718782466
  • f2b17720 on github
  • Prev Build on master (#25718401504)
  • Next Build on master (#25837450420)
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