I originally started writing this post a few months ago. Unfortunately I got wrapped up in other things and had to put this off. I don’t have much to add but wanted to just wrap this up. This is a continuation of my last post on refactoring the custom source control application in ruby. I will be working off the previous code, so be sure to grab a copy if you don’t already have it.
A while back, Aaron Patterson @tenderlove wrote a blog post on code coverage and ruby. He wrote a very basic code coverage tool using ruby’s built in stuff. I can’t find that post otherwise I’d link to it. I used what I learned in that post to build something to capture our code coverage in csc.
In specs/custom_coverage.rb add the following:
In specs/helper replace the contents with the following:
Now if you run it you’ll get some coverage to look at.
This was a fun experiment for me. It helped me better understand git, touched on TDD, and now code coverage. I hope those of you reading found it useful. Feel free to leave me any comments or feedback. You can find the project on github.