7

I have guard-spork running on my rails 3.2.11 project on Ubuntu 12.04.

I got my configuration from railstutorial.org.

Spork starts, then guard says it can't find spork to start, waits 30 secs, then 60 secs, then works.

It works, but starts up with an error everytime. Just wondering if there is something I am doing wrong.

How do I remove hooks for Test::Unit?

Error Message:

16:31:58 - INFO - Starting Spork for RSpec, Test::Unit
Using RSpec
Preloading Rails environment
Couldn't find a supported test framework that begins with 'testunit'

Supported test frameworks:
( ) Cucumber
(*) RSpec

Legend: ( ) - not detected in project   (*) - detected
Loading Spork.prefork block...
Rack::File headers parameter replaces cache_control after Rack 1.5.
Spork is ready and listening on 8989!
16:32:28 - ERROR - Could not start Spork server for RSpec, Test::Unit after 30 seconds. I will continue waiting for a further 60 seconds.

16:33:28 - ERROR - Could not start Spork server for RSpec, Test::Unit. Make sure you can use it manually first.
Dan Williams
  • 3,769
  • 1
  • 18
  • 26

3 Answers3

16

Or you can add test_unit: false as an option to guard-spork, i.e. in your Guardfile:

guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' }, :test_unit => false do

I acutally have some performance tests in my 'test' directory, so removing test/ is not always an option.

ipd
  • 5,674
  • 3
  • 34
  • 49
  • 1
    Thank You! I had this issue in several projects, I don't know why it automatically assumes you want to use Test Unit just because the files are there--I leave my files there just in case I want to use at some point but couldn't figure you why Spork kept trying to load it even though I didn't indicate this anywhere in the Guardfile – FireDragon May 09 '14 at 18:42
14

Figured it out. . .

Just erase the test folder in the rails application root

rm -r test/

Dan Williams
  • 3,769
  • 1
  • 18
  • 26
1

This error occurs only because of /test directory in the root of your application. Remove the /test directory and it should resolve the error.

Tarique
  • 4,017
  • 1
  • 26
  • 25