gpt4 book ai didi

ruby - 使用 guard-spork 时 Guard 崩溃 Spork

转载 作者:数据小太阳 更新时间:2023-10-29 07:10:12 27 4
gpt4 key购买 nike

我关注了 "How I Test" screencast at RailsCasts ,但是我遇到了 spork 的问题

$ guard
Guard is now watching at '/Users/darth/projects/auth-before'
Starting Spork for Test::Unit & RSpec
Couldn't find a supported test framework that begins with 'testunit'

Supported test frameworks:
( ) Cucumber
(*) RSpec

Legend: ( ) - not detected in project (*) - detected
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
ERROR: Could not start Spork server for Test::Unit & RSpec. Make sure you can use it manually first.

# here I get growl notification "Test::Unit & RSpec NOT started

Guard::RSpec is running, with RSpec 2!
Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/darth/.rvm/gems/ruby-1.9.2-p290/gems/guard-rspec-0.5.0/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.

Finished in 14.47 seconds
1 example, 0 failures
Done.

当我尝试在单独的终端窗口中运行 spork 时,它无济于事,因为一旦我运行 guard

它就会立即被杀死
$ spork
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Killed: 9

如果我只是运行 spork 然后尝试 rspec 。 --drb,它工作得很好。 <强> Here's link to gist使用我的 Gemfile、Guardfile 和 spec_helper.rb

最佳答案

你应该改变:

guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, 
:rspec_env => { 'RAILS_ENV' => 'test' },
:wait => 120

到:

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

关于ruby - 使用 guard-spork 时 Guard 崩溃 Spork,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7836803/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com