This repository was archived by the owner on Nov 30, 2024. It is now read-only.
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.
I recently learned that
# :nocov:
can be used to tag a chunk of code so simplecov doesn't consider it. Before learning that, I never bothered to try to get our coverage up because we have so many places where we do alternate method implementations for certain versions of ruby or for windows or whatever. With# :nocov:
, it's trivial to tag those so that we can actually meaningfully consider coverage.I've written a bit about my test coverage philosophy in the past. Besides all the alternate method implementations, keeping coverage up for RSpec's actually not hard, and I think we get enough value out of it to enforce it. I've seen a couple PRs from contributors where they added tests but because of how it was written it wasn't even executing the implementation it was intended to. Enforcing coverage will cause our travis build to catch such things for us.
In this PR, I've gotten coverage up to 100% and configured simplecov to enforce it on our "main" builds (travis builds for MRI >= 2.0), and I've stopped loading simplecov for other builds. The uncovered code generally fell into 3 categories:
# :nocov:
.Ideally, I'd like to see this same treatment done for expectations/mocks/support. Anyone want to take that on?
/cc @rspec/rspec