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

ruby-grape / grape / 33250554273 / 4
97%
master: 100%

Build:
Build:
LAST BUILD BRANCH: benchmark/grape-on-rack
DEFAULT BRANCH: master
Ran 29 Aug 2026 11:39AM 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 Aug 2026 11:37AM UTC coverage: 95.705% (-0.03%) from 95.732%
33250554273.4

Pull #2864

github

ericproulx
Check a group's type in one place for `requires` and `optional`

The rule that a group declaration needs a type was written twice: once in
`ParamsScope#new_scope`, guarded by `element && !optional` so it only ever
covered `requires`, and once inline in `optional`, which is what that
`!optional` clause existed to defer to.

Two copies of one rule drifted. `optional` captured `opts[:type]` before
merging in the attributes of an enclosing `with`, so a group type supplied
by `with` was invisible to it while `requires`, reading the same key after
the merge, saw it:

    with(type: Hash) do
      requires(:a) { requires :b, type: String }   # accepted
      optional(:a) { optional :b, type: String }   # MissingGroupType
    end

Delete the inline copy and drop `!optional` from the guard, so one check
covers both. `element` alone is sufficient there: `new_scope` is only ever
reached from the block branch of `requires`/`optional`. The `type` local in
`optional` went with it — it existed only to feed those two raises, so the
early read that caused the bug is gone rather than reordered.

A group with no type from either source still raises, and an unsupported
type still raises. One case stops raising: `optional :a, using: X do ... end`
now ignores the block instead of failing, matching what `requires` has
always done with that combination.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2864: Check a group's type in one place for `requires` and `optional`

1210 of 1324 branches covered (91.39%)

Branch coverage included in aggregate %.

3826 of 3938 relevant lines covered (97.16%)

1127.0 hits per line

Source Files on job run-3.3-gemfiles/rack_3_1.gemfile - 33250554273.4
  • Tree
  • List 167
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 33250554273
  • d1f68da9 on github
  • Prev Job for on unify-group-type-check (#33120993402.15)
  • Next Job for on unify-group-type-check (#33320060511.16)
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