我在Ubuntu 12.04的rails 3.2.11项目上运行了 guard 队。

我从railstutorial.org获得了配置。

Spork启动,然后 guard 说找不到启动的Spork,先等待30秒,然后等待60秒,然后再工作。

它可以工作,但是每次都会启动一个错误。只是想知道我是否做错了什么。

如何删除Test::Unit的钩子(Hook)?

错误信息:

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.

最佳答案

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

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

我在'test'目录中有一些性能测试,因此删除test/并非总是一种选择。

关于ruby-on-rails - Guard + spork + Rspec问题-如何删除Test::Unit的钩子(Hook)?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14791957/

10-13 03:06