New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ignore issues #346
Fix ignore issues #346
Conversation
…ng reporting, supporting regex
# then just filtering them out of the final report | ||
test 'ignores uses regex same as reporter does' do | ||
regex_file = Coverband.configuration.current_root + '/config/initializers/fake.rb' | ||
assert_equal true, @coverband.send(:track_file?, regex_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if possible we should try and avoid calling private methods and instance vars from our tests. Can make refactoring difficult later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know there is some advice about not testing private methods, I think we discussed it in another previous PR. I disagree with that testing advice as it makes tests far more complicated and makes it harder to interpret results. I think we will have different styles on this level of testing, which is cool as any project that has more than one dev has some divergent patterns.
Being able to target a highly specific method where complexity resides has at least for me, shown good value vs the tradeoffs of having to refactor tests when they change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Apologize for bringing the same issue again. Sometimes I think needing to test a private method, might be a good reason to extract the complicated logic into a class of its own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha no worries, this seems to be one of the few things we have different coding opinions on ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch!
These two issues came up while configuring Coverband for a new app... The vendor one, in particular, makes it look like we are missing data.
The move from include to match, is to keep the filters in sync we were allowing files in that we would filter out during reporting... This can lead to a lot of extra work for storage and merging.