October 26, 2026

undercover 0.9

Version 0.9 is out. It checks your ERB views, supports Ruby 4 and SimpleCov 1.x, and works better in monorepos.

View coverage

Until now undercover only looked at Ruby files. Now it works with SimpleCov's view coverage too, and splits your templates into blocks the same way it splits Ruby into methods: every if, case and loop becomes a unit of its own. So a warning points at the block you changed and the branch your tests missed, not at loose lines:

erb_annotation

It's opt-in and needs Ruby 3.2+. Turn on eval coverage in SimpleCov and add *.erb to your .undercover:

SimpleCov.start do
  enable_coverage :branch, :eval
end

-f (--include-files) sets the files undercover checks. It replaces the default list, so keep the Ruby patterns next to *.erb:

-f *.rb,*.rake,*.ru,Rakefile,*.erb

To skip a block on purpose, wrap it in <%# simplecov:disable %> and <%# simplecov:enable %> (SimpleCov 1.3+).

View coverage is in beta, so check the docs for the rough edges and please open an issue if something looks off.

Ruby 4

Parsing now goes through Prism, Ruby's own parser, and Ruby 4 is supported.

Monorepos

When your coverage report covers one app in a monorepo, changes outside that app are now ignored and SimpleCov's own filters are respected. Sparse checkouts work too.

SimpleCov 1.x

SimpleCov 1.x renamed some of its configuration methods. The old names still work but print deprecation warnings, so update your test helper when you upgrade:

SimpleCov.start do
  skip "/spec/"                   # was add_filter
  group "Models", "app/models"    # was add_group
  enable_coverage :branch, :eval  # was enable_coverage_for_eval
end

The full list is in SimpleCov's migration table.

Skips follow the 1.x syntax too. Code wrapped in # simplecov:disable / # simplecov:enable and files filtered with skip don't get flagged:

# simplecov:disable
def skip_this_method
  never_reached
end
# simplecov:enable

# :nocov: still works, but SimpleCov 1.0 deprecates it.

Upgrading

0.9 requires SimpleCov 1.0+ and Ruby 3.2+. Flag changes:

  • New: --commits-only checks only committed changes, for sparse or partial clones.
  • New: --no-hint (or UNDERCOVER_NO_HINT=1) hides the one-line hint after the report.
  • Changed: --include-files and --exclude-files globs are relative to the app your coverage report covers, so in a monorepo apps/dash/**/*.rb becomes **/*.rb.
  • Deprecated: --ruby-syntax (-r), since Prism parses every Ruby version.
  • Deprecated: --path, since the project root now comes from --git-dir.

Both deprecated flags do nothing and print a warning, so they won't break your build. Remove them from your .undercover when you upgrade.

Everything else, including performance improvements and bug fixes, is in the CHANGELOG.

Want these warnings on every pull request for your team? That's what UndercoverCI does.