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

ruby-grape / grape / 25973033231
97%

Build:
DEFAULT BRANCH: master
Ran 16 May 2026 09:10PM UTC
Jobs 37
Files 164
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

16 May 2026 09:10PM UTC coverage: 96.967% (+0.005%) from 96.962%
25973033231

push

github

web-flow
Introduce Grape::Validations::CoerceOptions value object (#2722)

`ValidationsSpec#coerce_options` returned an ad-hoc
`{ type:, method:, message: }` Hash that flowed (deep-frozen) into
`CoerceValidator` as its `options` argument and was poked at by
`ParamsScope#check_coerce_with` / `#validate_coerce`. Unlike most
validator options, this Hash is *never written by the user* — it is
assembled internally from the parsed `type:` / `coerce_with:` /
`coerce_message` declaration — so it has a fixed shape and no public
contract to preserve.

Replace it with a `Grape::Validations::CoerceOptions` Data value object
(`Data.define(:type, :coerce_method, :message)`, all defaulting nil).
The member is `coerce_method`, not `method`, to avoid shadowing
`Object#method` (`Lint/DataDefineOverride`); it also matches
`ValidationsSpec`'s existing `coerce_method` vocabulary.

- `ValidationsSpec#coerce_options` builds the value object.
- `ParamsScope#check_coerce_with` / `#validate_coerce` read `.type` /
  `.coerce_method` instead of `[:type]` / `[:method]`.
- `CoerceValidator` reads `@options.type` / `@options.coerce_method`.
  `Base#message` can't see a custom message off a Data (it probes
  Hash-like `key?`), so `CoerceValidator#initialize` restores
  `@exception_message` from `@options.message`, preserving
  `type: { value:, message: }` behaviour.

`Grape::Util::DeepFreeze` returns the Data as-is (its `else` branch);
`Base.new` already freezes the whole validator instance, and the Data
is structurally immutable. No user-facing contract changes — users
never construct or read this Hash; no spec hand-builds it.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

1084 of 1169 branches covered (92.73%)

Branch coverage included in aggregate %.

13 of 13 new or added lines in 4 files covered. (100.0%)

3520 of 3579 relevant lines covered (98.35%)

31713.29 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.4-gemfiles/rack_2_2.gemfile - 25973033231.1 16 May 2026 09:10PM UTC 163
95.63
GitHub Action Run
2 run-3.2-gemfiles/rails_7_2.gemfile - 25973033231.2 16 May 2026 09:10PM UTC 164
95.72
GitHub Action Run
3 run-3.3-gemfiles/rack_3_2.gemfile - 25973033231.3 16 May 2026 09:11PM UTC 163
95.67
GitHub Action Run
4 run-3.2-gemfiles/rack_3_0.gemfile - 25973033231.4 16 May 2026 09:10PM UTC 163
95.72
GitHub Action Run
5 run-3.2-gemfiles/rails_8_0.gemfile - 25973033231.5 16 May 2026 09:10PM UTC 164
95.72
GitHub Action Run
6 run-3.3-Gemfile - 25973033231.6 16 May 2026 09:10PM UTC 163
95.67
GitHub Action Run
7 run-4.0-gemfiles/grape_entity.gemfile - 25973033231.7 16 May 2026 09:11PM UTC 163
50.23
GitHub Action Run
8 run-4.0-gemfiles/multi_json.gemfile - 25973033231.8 16 May 2026 09:11PM UTC 163
36.66
GitHub Action Run
9 run-3.2-Gemfile - 25973033231.9 16 May 2026 09:11PM UTC 163
95.72
GitHub Action Run
10 run-3.2-gemfiles/rack_3_1.gemfile - 25973033231.10 16 May 2026 09:10PM UTC 163
95.72
GitHub Action Run
11 run-4.0-gemfiles/rack_3_1.gemfile - 25973033231.11 16 May 2026 09:10PM UTC 163
95.67
GitHub Action Run
12 run-4.0-gemfiles/rack_2_2.gemfile - 25973033231.12 16 May 2026 09:11PM UTC 163
95.63
GitHub Action Run
13 run-3.3-gemfiles/rack_3_0.gemfile - 25973033231.13 16 May 2026 09:11PM UTC 163
95.67
GitHub Action Run
14 run-4.0-gemfiles/rails_7_2.gemfile - 25973033231.14 16 May 2026 09:11PM UTC 164
95.68
GitHub Action Run
15 run-3.2-gemfiles/rails_8_1.gemfile - 25973033231.15 16 May 2026 09:11PM UTC 164
95.72
GitHub Action Run
16 run-4.0-gemfiles/multi_xml.gemfile - 25973033231.16 16 May 2026 09:11PM UTC 163
36.66
GitHub Action Run
17 run-3.2-gemfiles/rack_2_2.gemfile - 25973033231.17 16 May 2026 09:10PM UTC 163
95.67
GitHub Action Run
18 run-3.4-gemfiles/rails_8_1.gemfile - 25973033231.18 16 May 2026 09:11PM UTC 164
95.68
GitHub Action Run
19 run-3.3-gemfiles/rails_8_0.gemfile - 25973033231.19 16 May 2026 09:11PM UTC 164
95.68
GitHub Action Run
20 run-4.0-gemfiles/rails_8_1.gemfile - 25973033231.20 16 May 2026 09:11PM UTC 164
95.68
GitHub Action Run
21 run-3.4-gemfiles/rack_3_0.gemfile - 25973033231.21 16 May 2026 09:10PM UTC 163
95.67
GitHub Action Run
22 run-3.4-gemfiles/rack_3_2.gemfile - 25973033231.22 16 May 2026 09:11PM UTC 163
95.67
GitHub Action Run
23 run-4.0-gemfiles/dry_validation.gemfile - 25973033231.23 16 May 2026 09:10PM UTC 163
58.32
GitHub Action Run
24 run-4.0-gemfiles/hashie.gemfile - 25973033231.24 16 May 2026 09:10PM UTC 163
62.58
GitHub Action Run
25 run-3.3-gemfiles/rack_2_2.gemfile - 25973033231.25 16 May 2026 09:11PM UTC 163
95.63
GitHub Action Run
26 run-3.4-Gemfile - 25973033231.26 16 May 2026 09:11PM UTC 163
95.67
GitHub Action Run
27 run-4.0-gemfiles/rack_3_0.gemfile - 25973033231.27 16 May 2026 09:10PM UTC 163
95.67
GitHub Action Run
28 run-3.2-gemfiles/rack_3_2.gemfile - 25973033231.28 16 May 2026 09:10PM UTC 163
95.72
GitHub Action Run
29 run-4.0-Gemfile - 25973033231.29 16 May 2026 09:11PM UTC 163
95.67
GitHub Action Run
30 run-3.3-gemfiles/rails_7_2.gemfile - 25973033231.30 16 May 2026 09:11PM UTC 164
95.68
GitHub Action Run
31 run-3.4-gemfiles/rails_8_0.gemfile - 25973033231.31 16 May 2026 09:11PM UTC 164
95.68
GitHub Action Run
32 run-4.0-gemfiles/rails_8_0.gemfile - 25973033231.32 16 May 2026 09:11PM UTC 164
95.68
GitHub Action Run
33 run-3.3-gemfiles/rails_8_1.gemfile - 25973033231.33 16 May 2026 09:11PM UTC 164
95.68
GitHub Action Run
34 run-3.4-gemfiles/rails_7_2.gemfile - 25973033231.34 16 May 2026 09:11PM UTC 164
95.68
GitHub Action Run
35 run-4.0-gemfiles/rack_3_2.gemfile - 25973033231.35 16 May 2026 09:11PM UTC 163
95.67
GitHub Action Run
36 run-3.4-gemfiles/rack_3_1.gemfile - 25973033231.36 16 May 2026 09:11PM UTC 163
95.67
GitHub Action Run
37 run-3.3-gemfiles/rack_3_1.gemfile - 25973033231.37 16 May 2026 09:11PM UTC 163
95.67
GitHub Action Run
Source Files on build 25973033231
  • Tree
  • List 164
  • Changed 4
  • Source Changed 3
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25973033231
  • 2d224ab6 on github
  • Prev Build on master (#25972968115)
  • Next Build on master (#25973567226)
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