我是BDD的新手。每次我尝试使用黄瓜,我发现它很慢。我曾在两台不同的机器上尝试过使用Rails 3.0.9 & 3.1。其中一台机器是具有2 GB RAM的旧IBM ThinkPad笔记本电脑;另一个是4 GB RAM的PC [如果需要,我可以得到确切的规格]。两者都运行Fedora 14.运行测试时黄瓜很慢[在两个不同的Fedora机器上测试]
即使没有scnerios的新应用程序黄瓜需要几分钟。这是怎么一回事呢:
$ cucumber
Using the default profile...
--- about 2 minutes delay---- and then it says:
0 scenarios
0 steps
0m0.000s
相比之下,Rspec的是即时的:
rspec
No examples found.
Finished in 0.00005 seconds
0 examples, 0 failures
同时黄瓜说花了0m0.000s;它在现实中花了大约2分钟。而且,RSpec是即时的并且正确显示时间:0.00005秒。
这是正常的。我是否需要一些额外的宝石或设置来加快处理速度。
更新:这里是更多的数据:
先用黄瓜:
$time cucumber
Using the default profile...
0 scenarios
0 steps
0m0.000s
real 0m53.489s
user 0m37.051s
sys 0m1.973s
,然后用rspec的
$ time rspec spec/
No examples found.
Finished in 0.00005 seconds
0 examples, 0 failures
real 0m1.925s
user 0m1.032s
sys 0m0.155s
谢谢!那么解决方案是什么?为什么rspec更快! – RubyDev
我的测试目前运行缓慢,但我的应用程序是在PHP中。 – Rimian
我想说@Aslak是正确的。而且,我认为在黄瓜身上获得了一些经验,我认为他为此得到-4是相当不公平的。 – RubyDev