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
uninitialized constant RSpec
for rspec > 3
#61
Comments
Actually, I've noticed that this doesn't fix it. The problem is that rspec-rails now creates a So, I hacked around in tork to check for the ENV["RAILS_ENV"] ||= 'test'
require 'spec_helper'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails' to: ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'spec_helper' I.e. the So it seems like checking for the Is this making any sense? Thanks for the great gem, I love it! |
Thanks for the positive feedback! 😺 Your |
I was convinced that I'd replied to this. Turned out I hadn't. Sigh. I think yours is a much better idea than mine. 👍 |
Alright, is there as easy way to detect if "rspec-rails" is installed? 🍰 Can we test if a particular file exists or must we grep the spec_helper file? |
Hi,
I'm not sure whether this is a bug or a problem with my environment, but I'm consistently getting this error immediately on starting tork (using version 19.10.0):
The
spec_helper
isn't anything special, just the one generated by rails (using rspec-rails version 3.0.3, the latest):I did a little digging, and noted that earlier versions of rspec-rails explicitly put the following at the top of the spec helper:
Adding this back in to the spec helper seems to fix the problem, but I'm very aware that the rspec-rails team removed this for a reason. Do you have any thoughts on the best way to approach this? I.e. should this code be added to allow for use with tork, or is there something you can add to tork itself to automatically load the environment and rspec-rails?
Maybe a first action would be to add it to the documentation, in case other people are coming across it.
Hope this is helpful. Thanks
The text was updated successfully, but these errors were encountered: