Fix for defining groups based on a custom filter class. #85
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.
Problem
The following LineFilter example is mentioned in the documentation of SimpleCov. I tried this out and configured SimpleCov as follows:
Instead of showing me the files that have less then 5 lines, the tab 'Short files' contains all files that are greater than or equal to 5 lines.
Fixes
The initial fix was removing the negation from the
grouped
method inlib/simplecov.rb
. This led to some underlying problems in the SimpleCov::Filter classes.I renamed the
passes?
method tomatches?
and also removed the negation that was present. The comments in the StringFilter and LineFilter class now match the code :) The changes made intest/test_filters.rb
are trivial changes because of the removed negation.I also had to change the
filtered
method inlib/simplecov.rb
. This method now removes (or reject) all files that match the filter. This is functionally still the same.I added a specific feature for testing the custom filter class (no existing one was present).