Skip to content

Fix SourceAnnotationExtractor on Rails 6 #1997

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

Merged
merged 1 commit into from
Jun 18, 2018
Merged

Fix SourceAnnotationExtractor on Rails 6 #1997

merged 1 commit into from
Jun 18, 2018

Conversation

brian-kephart
Copy link
Contributor

Without this fix, my tests fail when loading RSpec.
uninitialized constant RSpec::Rails::SourceAnnotationExtractor

With the fix, the constant is appropriately nested under the top-level Rails constant instead of trying to nest under RSpec, so my tests pass again.

@brian-kephart
Copy link
Contributor Author

See build errors here: https://travis-ci.com/brian-kephart/camaleon-cms/jobs/125697021

And the last comment here: #1984

@brian-kephart
Copy link
Contributor Author

When I submitted this PR, the rails-controller-testing gem would not load in Rails 6, so the effect of this PR on the test suite could not be evaluated directly. This changed allowed a repo that depends on rspec-rails to build correctly, which was indirect evidence of its effect.

Since then, rails-controller-testing has been updated, so now the tests can be run on Rails master (at least until another problem is encountered). See results here.

With the updated rails-controller-testing gem but without the change from this PR, this is the result.

@nbulaj
Copy link

nbulaj commented Jun 6, 2018

I'm using master branch of RSpec with Rails master and still see this error also:

https://travis-ci.org/doorkeeper-gem/doorkeeper/jobs/380759360

@JonRowe JonRowe merged commit 15fb5bb into rspec:master Jun 18, 2018
@JonRowe
Copy link
Member

JonRowe commented Jun 18, 2018

Thanks for this!

@dsandstrom
Copy link

If you encounter a similar error after updating to Rails 6.1, try updating rspec to 3.10+ and rspec-rails to 4.0+.

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.

4 participants