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

Update instuctions for usage with spring to suggest Rails.application.eager_load! #678

Merged
merged 1 commit into from
May 20, 2018

Conversation

scmx
Copy link
Contributor

@scmx scmx commented May 20, 2018

A cleaner solution to usage with spring than copying SimpleCov.start code to config/spring.rb. 🍝

According to suggestion from @ibrahima here #381 (comment)
and @adampope here https://stormconsultancy.co.uk/blog/development/ruby-on-rails/getting-accurate-code-coverage-metrics-from-simplecov-rails-project/

I took a chance and removed the current instruction because I felt it wasn't as good, but I'll gladly add it back if you feel that both should be there. 😇

I'm not sure if there are any cons to calling eager load here so it would be good to hear from more people if this is a good solution. 📣

For my rails project I got 0% coverage until I copied SimpleCov.start if Rails.env.test? into config/spring.rb, then I looked around until I found the eager load solution. I also tried with DISABLE_SPRING=1 as suggested here #381 (comment) but that didn't seem to do anything.

Copy link
Collaborator

@PragTob PragTob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

As I had my own problems getting spring to run I'll believe your experience and take this :)

@PragTob PragTob merged commit b4b558a into simplecov-ruby:master May 20, 2018
@scmx scmx deleted the spring-explicitly-eager-load branch May 20, 2018 22:04
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

Successfully merging this pull request may close these issues.

2 participants