sporkrb / spork

A DRb server for testing frameworks (RSpec / Cucumber currently) that forks before each run to ensure a clean testing state.
spork.rubyforge.org
MIT License
1.4k stars 202 forks source link

Test helpers not found #207

Open PizzaPill opened 12 years ago

PizzaPill commented 12 years ago

I have isolated this error, please take a look at the example here: https://github.com/PizzaPill/spork-error

If I add a module to the rails /config/initializers that skips a before_filter spork doesn't find the methods in /app/helpers/application_helper.rb any more.

To demonstrate this do the following:

  1. Run specs with rspec spec/ - specs pass
  2. Run spork & rspec - specs fail
  3. Comment out line #12 in /config/initializer/skip_before_filter.rb and run spork & rspec - specs pass

I opened this new issue altough I'm aware of spork issue #109 and spork-rails issue #6 because I don't know if they are related and/or if I simply did something wrong in the configuration/setup.

pedrobachiega commented 12 years ago

about the relateds, I am with the problem to load helpers here...

if I include each helper, it works, but I would know some clean way to do this

Spork.prefork do
  ENV["RAILS_ENV"] ||= 'test'
  require File.expand_path("../../config/environment", __FILE__)
  require 'rspec/rails'
  require 'shoulda/matchers/integrations/rspec'
  include ApplicationHelper
  include GraphicsHelper
  ...

I try to remove all before_filter calls at initializers, but this not make effect