使用 Guard-Spork 时 Guard 会导致 Spork 崩溃
我已经关注了 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
,它工作得很好。 这是要点链接以及我的 Gemfile、Guardfile 和 spec_helper.rb
I've followd the "How I Test" screencast at RailsCasts, however I ran into a problem with 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.
When I try to run spork
in a separate terminal window, it doesn't help, as it gets killed instantly once I run guard
$ spork
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Killed: 9
If I just run spork
and then try rspec . --drb
, it works just fine. Here's link to gist with my Gemfile, Guardfile and spec_helper.rb
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该将:更改
为:
You should change:
to:
这个问题实际上是由
guard
在加载之前杀死spork
造成的,这是我的较慢 MacBook pro 上的问题。解决方案是通过
:wait => 增加等待时间
,例如Guardfile
中的 120This problem is actually caused by
guard
killingspork
before it can even load, which is a problem on my slower MacBook pro.The solution is to increase the wait time with
:wait => 120
in theGuardfile
, e.g.