Search code examples
ruby-on-railsrubyrspecrcov

what is the best way to measure code coverage against a single spec with ruby?


I typically do rake spec:rcov but that measures code coverage across all tests.

I would like a way to measure code coverage from one spec to help ensure that each model's spec is testing the full model rather relying on side effects in other tests.

Any ideas?


Solution

  • rcov test/*.rb 
    

    I might not be understanding your question exactly, but if you are trying to spec just a portion of your code, this command should do it.

    I read about it here: http://eigenclass.org/hiki.rb?rcov#l6