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

Load spec_helper before Rails #1795

Merged
merged 1 commit into from
Mar 28, 2017
Merged

Conversation

kjg
Copy link
Contributor

@kjg kjg commented Mar 22, 2017

so that things in spec_helper, especially coverage tools,
have a chance to load before the Rails code loads

so that things in spec_helper, especially coverage tools,
have a chance to load before the Rails code loads
@fables-tales
Copy link
Member

@kjg I'm not entirely sure about this. Can you explain your use case or need a little more?

@kjg
Copy link
Contributor Author

kjg commented Mar 28, 2017

@samphippen Simplecov, for example, says that it must be loaded before any of the application code in order to properly track code coverage.

If you have your Simplecov init in your spec_helper (which makes sense because you want coverage on all files, not just files that need rails_helper), you have Simplecov init at the top of spec_helper, but rails_helper is loading your Rails files before spec_helper and therefor before Simplecov.

Does that make sense?

@JonRowe JonRowe merged commit e6ecf55 into rspec:master Mar 28, 2017
@JonRowe
Copy link
Member

JonRowe commented Mar 28, 2017

@samphippen I would recommend this change as well to be honest, given spec_helper should be rails free I think it's safe to merge this. Thanks @kjg

@JonRowe
Copy link
Member

JonRowe commented Mar 28, 2017

TIL hitting merge doesn't also post your comment :)

JonRowe added a commit that referenced this pull request Mar 28, 2017
@kjg kjg deleted the load_spec_helper_first branch March 29, 2017 14:47
sebjacobs pushed a commit to futurelearn/rspec-rails that referenced this pull request Mar 15, 2019
so that things in spec_helper, especially coverage tools,
have a chance to load before the Rails code loads
sebjacobs pushed a commit to futurelearn/rspec-rails that referenced this pull request Mar 15, 2019
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.

3 participants