Code coverage of new lines between two commits in ruby

I would like to make sure that all new lines written by the added ones are covered by the test. Is there an easy way to make the intersection between git diff and the simplest coverage.

http://fredwu.me/post/35625566267/simplecov-test-coverage-for-changed-files-only something like this, but with line granularity instead of files

+5
source share
1 answer

For git diffs, there is a tool called diff-cover that can check coverage. It takes XML coverage reports in Cobertura and compares with the output of git diff . It then reports the coverage information for the lines in diff.

With the xml file created by simplecov-cobertura , you can use this command to check the scope of your changes compared to the master industry:

 $ diff-cover coverage.xml 
+3
source

Source: https://habr.com/ru/post/1208374/


All Articles