Guard + spork + Rspec问题 - 如何删除Test :: Unit的钩子?

时间:2013-02-09 21:46:21

标签: ruby-on-rails rspec guard testunit spork

我在Ubuntu 12.04的rails 3.2.11项目中运行了guard-spork。

我从railstutorial.org获得了配置。

Spork开始,然后后卫说它找不到spork开始,等待30秒,然后60秒,然后工作。

它可以工作,但每次都会出错。只是想知道我做错了什么。

如何删除Test :: Unit的挂钩?

错误讯息:

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.

3 个答案:

答案 0 :(得分:16)

或者您可以添加test_unit: false作为guard-spork的选项,即在您的Guardfile中:

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

我在'test'目录中执行了一些性能测试,因此删除test /并不总是一个选项。

答案 1 :(得分:14)

想出来。 。 。

只需删除rails应用程序根目录中的测试文件夹

rm -r test /

答案 2 :(得分:1)

发生此错误只是因为应用程序根目录中的/ test目录。删除/ test目录,它应该解决错误。