Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't count files under lib #12

Closed
ywen opened this issue Oct 23, 2010 · 4 comments
Closed

doesn't count files under lib #12

ywen opened this issue Oct 23, 2010 · 4 comments

Comments

@ywen
Copy link

ywen commented Oct 23, 2010

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?

@colszowka
Copy link
Collaborator

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

@lastobelus
Copy link

however perhaps there is a deeper issue? see #221

@tilo
Copy link

tilo commented May 19, 2022

@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.

@PragTob
Copy link
Collaborator

PragTob commented Jul 8, 2022

@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.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants