I would like to ensure that all new lines written added are covered by test. Is there a simple way to do an intersection between git diff and simplecov coverage.
http://fredwu.me/post/35625566267/simplecov-test-coverage-for-changed-files-only something like this but with lines granularity instead of files
For git diffs, there is a tool named diff-cover, which can check coverage. It takes Cobertura XML coverage reports and compares with the output of git diff
. It then reports coverage information for lines in the diff.
With an xml file produced by simplecov-cobertura, you can use this command to check the coverage of your changes compared to the master
branch:
$ diff-cover coverage.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With