Improve code coverage for `lib/banzai/renderer.rb`
Problem
The code coverage of lib/banzai/renderer.rb
(via SIMPLECOV=1 bin/rspec spec/lib/banzai/renderer_spec.rb
) is ~60%.
Having a test-gap might cause problems in cases where code is changed automatically (via autocorrection feature of RuboCop, see !94047 (comment 1179689274)) and potential mistakes are not caught is unit specs. Though, they might have been caught in CI because it has a code coverage of %100 across _all _ specs.
Singe file - Overview 60% | Singe file - Details 60% | All specs - Overview 100% |
---|---|---|
![]() |
![]() |
![]() |
Proposed solution
Add more specs to spec/lib/banzai/renderer_spec.rb
to cover all lines (C0 coverage) from lib/banzai/renderer.rb
.
Then, after applying bundle exec rubocop -a --only Rails/Pluck lib/banzai/renderer.rb
should fail.
Refs
Edited by Peter Leitzen