当我仅使用spork运行我的规范时,我获得了相当显著的性能提升
$ time rspec .
.....
Finished in 11.39 seconds
5 examples, 0 failures
real 0m11.780s
user 0m10.318s
sys 0m1.180s外加猪肉
$ time rspec . --drb
.....
Finished in 107.24 seconds
5 examples, 0 failures
real 0m1.968s
user 0m0.488s
sys 0m0.095s这真是太棒了。但是一旦我把守卫放进游戏中,似乎所有的东西都运行得很慢,就好像根本没有叉子一样。
$ guard
Guard is now watching at '/Users/darth/projects/scvrush'
Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork server for RSpec successfully started
Guard::RSpec is running, with RSpec 2!
Running all specs
.....
Finished in 10.77 seconds
5 examples, 0 failures即使我不看Finished in 10.77 seconds,每次它尝试运行一个规范时,我至少可以数到6-8秒,即使只有一个型号。
我做了一些minor edits to the Guardfile,比如:wait => 120,但这应该只在guard启动时起作用。
发布于 2011-10-30 03:52:54
您必须在Guardfile中传递rspec的--drb选项,如下所示:
guard 'rspec', :version => 2, :cli => '--drb' do
...
endhttps://stackoverflow.com/questions/7939134
复制相似问题