Guard + spork + Rspec issue - How do I remove hooks to Test::Unit?
Asked Answered
M

3

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.
Merriment answered 9/2, 2013 at 21:46 Comment(2)
Please put your solution as an answer to your question and accept it. Do not edit your question title as "SOLVED"Velour
thanks Serkan. I'll change it right now. My first question, so i appreciate the heads up!Merriment
R
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.

Rewarding answered 1/4, 2013 at 21:18 Comment(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 GuardfilePedicle
M
14

Figured it out. . .

Just erase the test folder in the rails application root

rm -r test/

Merriment answered 10/2, 2013 at 16:11 Comment(1)
guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' }, :test_unit => false do <br> then rm -r test/Hallo
R
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.

Reconstructionist answered 31/8, 2013 at 6:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.