Closed ywen closed 13 years ago
By default, Rails does not require
files in lib - try a require 'yourlib'
in your environment.rb or a model/controller class that uses the lib
however perhaps there is a deeper issue? see https://github.com/colszowka/simplecov/issues/221
@colszowka @amatsuda
so this means: if you use SimpleCov for getting coverage on a Ruby Gem, then you're out of luck, because it doesn't consider files under ./lib
.
This feels completely broken.
the project description says: "Code coverage for Ruby" , not "for Rails"
this should be fixed.
@tilo it works completely fine, you just need to require your code after simplecov was started as the README indicates. Many people use simplecov for gem code coverage and it's perfectly fine.
I have this rails project in which I try simplecov. I had 100% coverage. then I created a dummy class in lib, and put a dummy method into it. ran spec again, the coverage was still 100%. Now I moved the same file into app/model. the coverage changed to 98%. Why didn't the files under lib get counted?