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

Custom CoverMe.config settings are ignored #66

Open
macmartine opened this issue Sep 14, 2011 · 4 comments
Open

Custom CoverMe.config settings are ignored #66

macmartine opened this issue Sep 14, 2011 · 4 comments

Comments

@macmartine
Copy link

I created a file cover_me.rb and put it in /initializers

cover_me ignores these settings and always uses defaults.

@macmartine
Copy link
Author

I can get it to work if I change c.project.root (I'm changing it to "test")

@cimm
Copy link

cimm commented Sep 15, 2011

I am no expert and just discovering CoverMe but I think you have to add your configuration in your test configuration file (like spec_helper.rb for RSpec). Otherwise it would be loaded when you load Rails and I don't see why you would want to load the CoverMe configuration in a production environment for example.

@macmartine
Copy link
Author

I have it surrounded by an: if Rails.env.test?

@mwindholtz
Copy link

This worked for me.
I put the config into the cover_me rake task.

lib/tasks/cover_me.rake ...

task :report do
require 'cover_me'
CoverMe.config.exclude_file_patterns = [
/(#{CoverMe.config.project.root}/app/admin/.+.rb)/i # ignore active admin section
]
CoverMe.complete!
end

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

3 participants