Bring test suite line coverage to 100% - #2896
Open
dblock wants to merge 1 commit into
Open
Conversation
Danger ReportNo issues found. |
dblock
force-pushed
the
add-coverage-100
branch
from
September 4, 2026 10:35
bd75a35 to
3744309
Compare
dblock
commented
Sep 4, 2026
dblock
left a comment
Member
Author
There was a problem hiding this comment.
Flagging one change for @ericproulx to confirm intent (rest of the PR is coverage-only spec additions).
| ) | ||
| formatter.call(error:, env:, include_backtrace:, include_original_exception:) | ||
| end | ||
|
|
Member
Author
There was a problem hiding this comment.
@ericproulx I removed this branch as dead code: Grape::ErrorFormatter.formatter_for always falls back to Txt (registered via ErrorFormatter::Base.inherited), so formatter here can never be falsy and this 406 throw could never execute. Confirming this was unintentional dead code and not a bug elsewhere (e.g. in formatter_for's fallback) that should instead make this branch reachable again. Happy to revert/adjust if the intent was different.
dblock
force-pushed
the
add-coverage-100
branch
3 times, most recently
from
September 4, 2026 10:44
a56918f to
fcb6cad
Compare
Add specs for previously-untested classes/methods and branches across the middleware, router, serve_stream, util, validations and exceptions namespaces. Also remove a structurally unreachable "format not supported" throw in Grape::Middleware::Error#format_message: formatter_for always falls back to a registered Txt formatter (registered via ErrorFormatter::Base.inherited), so `formatter` can never be falsy and the 406 branch could never execute. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dblock
force-pushed
the
add-coverage-100
branch
from
September 4, 2026 10:45
fcb6cad to
fb38d72
Compare
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Brings line coverage of the test suite to 100% (up from ~98.3%/93.0%).
Adds specs for previously-untested classes/methods and branches across the middleware, router, serve_stream, util, validations and exceptions namespaces.
Marks two branches that appear structurally unreachable through the public API with a
# simplecov:disable/# simplecov:enableblock and an explanatory comment (see inline PR comment tagging @ericproulx to confirm before anything is actually removed):Grape::Middleware::Error#format_message's 406 "format not supported" throw, sinceGrape::ErrorFormatter.formatter_foralways falls back to a registeredTxtformatter (Grape::ErrorFormatter::Base.inheritedregisters every formatter subclass, includingTxt), soformattercan never be falsy.Grape::Router::Route#tag_utf8!'selsebranch, since Mustermann'sPattern#paramsonly ever returnsString/Arraycaptures, and the only caller filters outnilfirst.Branch coverage improved from 92.97% to 93.94% along the way, but was not brought to 100% as part of this PR given the scope of the remaining work.
Verification
bundle exec rspec- full suite, 0 failuresbundle exec rubocop- clean