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

ruby-grape / grape / 30485610217 / 24
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 29 Jul 2026 07:43PM UTC
Files 167
Run time 6s
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

29 Jul 2026 07:42PM UTC coverage: 95.588% (+0.009%) from 95.579%
30485610217.24

push

github

web-flow
Define #hash alongside the eql?/== pairs that lacked one (#2836)

Five classes alias eql? to == without defining hash: Grape::Endpoint,
Grape::Util::InheritableSetting, Grape::Middleware::Stack::Middleware,
Grape::ServeStream::StreamResponse and Grape::ServeStream::FileBody.
Ruby requires equal objects to hash alike, so each of them silently
misbehaves in a Hash, a Set or under uniq -- equal objects land in
different buckets and never dedup. Grape::Namespace and
Grape::Util::MediaType already pair the two; this brings the rest in line.

Each hash mirrors exactly what its == compares, and nothing more:

- StreamResponse / FileBody key on stream / path alone. Their == does not
  check the class, so the class stays out of the hash.
- Middleware keys on the wrapped class, which also makes it agree with the
  class itself -- something its == accepts. The superclass fallback cannot
  be honoured (a class and its superclass hash differently); it only ever
  serves #index / #include?, which compare with == rather than by hash.
- Endpoint keys on config and inheritable_setting, omitting the class,
  since its == admits a subclass through is_a? and such a pair must agree.
- InheritableSetting keys on the resolved state (#to_hash). Its == accepts
  two instances whose own stores differ as long as their chains resolve
  alike, so hashing own state would tell those apart. The same-parent fast
  path implies equal resolved state, so it agrees too. This is the cold
  path -- nothing in Grape uses a setting as a Hash key, and == keeps
  avoiding to_hash wherever it can.

No caller in Grape relies on hash lookups for these, so this closes a
latent hole rather than fixing an observed failure.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

1167 of 1280 branches covered (91.17%)

Branch coverage included in aggregate %.

3751 of 3865 relevant lines covered (97.05%)

1115.5 hits per line

Source Files on job run-4.0-gemfiles/rails_8_0.gemfile - 30485610217.24
  • Tree
  • List 167
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 30485610217
  • 6815cf8c on github
  • Prev Job for on master (#30485393298.22)
  • Next Job for on master (#30485820748.12)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc