-
Notifications
You must be signed in to change notification settings - Fork 899
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
rspec extensions not working with spork #278
Comments
Interesting, just went to the spork issues wiki, and found a link to this StackOverflow post. I'm thinking that you could do something like this: # spec/spec_helpr.rb
require 'rubygems'
require 'spork'
Spork.prefork do
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'paper_trail/frameworks/rspec'
...
end I haven't used spork before so I can't say that would work for certain. If this doesn't work, then I'm wondering if I may need to change the way the code for the frameworks gets required so that the In If the suggested code doesn't work above, perhaps try swapping this in for the load 'paper_trail/frameworks/rspec.rb' # should force a reload of the file regardless of whether it was required previously Please let me know if either of those works and I'll try to change the code and/or the README accordingly. |
Ok, so I just cloned down the app and tried the two methods I suggested above. Looks like the |
Just tried I think your way of requiring the helpers is a smart move. If it can be improved for zeus/spork compatibility, great, but if not, I guess a note on paper_trail's readme for zeus/spork users with this solution will be very helpful. Thanks again! |
Just pushed a 39decb3, which makes it so the note: you'll need to clone down the |
Awesome! 👍 |
When using spork, paper_trail's rspec helpers are not being loaded. I tried to load them manually but couldn't do it.
I created a sample project that reproduces the issue at https://github.com/dipnlik/paper_trail_sandbox .
Not sure if it's a paper_trail bug or a spork bug, but #272 looks similar to this, only with zeus instead of spork (both are preloading tools that aim to run specs faster).
I'm using ruby 2.0.0p247, rails 4.0.0, paper_trail 3.0.0.beta1 and spork-rails 4.0.0 straight from github because it wouldn't work with rails 4 otherwise.
Will keep doing tests by myself, but any help will be greatly appreciated.
The text was updated successfully, but these errors were encountered: