Skip to content

Add SimpleCov and Coveralls integration, bring coverage to 100% - #95

Merged
dblock merged 1 commit into
ruby-grape:masterfrom
dblock:add-simplecov-coveralls
Sep 3, 2026
Merged

dblock merged 1 commit into
ruby-grape:masterfrom
dblock:add-simplecov-coveralls

Conversation

@dblock

@dblock dblock commented Sep 3, 2026

Copy link
Copy Markdown
Member

Description

Adds SimpleCov coverage tracking with the Coveralls GitHub Action, following the same convention used in ruby-grape/grape.

  • Added simplecov and simplecov-lcov to the test group.
  • Added .simplecov config (line + branch coverage, lcov output for Coveralls in CI).
  • Required simplecov first in spec/spec_helper.rb.
  • Added coverage to .gitignore.
  • Updated .github/workflows/test.yml to report to Coveralls per matrix entry (parallel) with a finish job.
  • Added a Coverage Status badge to the README.

Coverage is now 100% (line and branch):

  • Added a test in spec/api/get_json_spec.rb for the non-JSON param rescue branch in Acme::GetJson.
  • Documented the unreachable fallback lambda passed to Rack::Static.new in Acme::App with an explanatory comment (urls: ['/'] matches every request, so the fallback app is never actually invoked), marked with simplecov:disable/simplecov:enable rather than writing a synthetic test for genuinely dead code.

Testing

  • bundle exec rspec - 43 examples, 0 failures, 100% line/branch coverage.
  • bundle exec rubocop - clean, no offenses.

Adds a test for the non-JSON param rescue branch in Acme::GetJson,
and documents (with an explanatory comment marked for SimpleCov
exclusion) the unreachable fallback lambda passed to Rack::Static in
Acme::App, since urls: ['/'] matches every request and never falls
back to it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock force-pushed the add-simplecov-coveralls branch from ecc1301 to fb1981c Compare September 3, 2026 23:17
@dblock
dblock merged commit 896bec2 into ruby-grape:master Sep 3, 2026
4 checks passed
@dblock
dblock deleted the add-simplecov-coveralls branch September 3, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant