Fastest way to do BDD/TDD in Rails?
I would appreciate some advice on the following predicament:
I really want to give BDD a try with my first real Rails project but I can't get past the debilitating wait every time I try and run cucumber or Rspec. I running Windows Vista and using rails 3.0.1 and ruby 1.9.2p136. I've tried spork, which I found incredibly difficult to follow the hacks and get working on rails 3.0.1. Now I have it installed and - supposedly - working (followed the instructions on this link: http://railstutorial.org/chapters/static-pages#sec:spork and no longer experience any of the errors I used to when I tried to set it up myself) I still experience 45 - 60 second wait times to run a single, generic cucumber scenario.
It's beyond me how the rails community can tolerate these wait times and still develop using BDD/TDD practices. I've been learning from the RSpec Book and there was no mention of having to endure the ridiculous load times that I've encountered (although there are still a few chapters I've not yet read). So is the rails community ignoring this issue, or am I experiencing unusual delays?
I have a reasonable quick laptop I'm working on (Intel Core 2 Duo CPU T9400 2.53Hz each) 4 GB RAM.
I really would like some guidance on this because after close to two weeks trying make this work I'm abou开发者_运维百科t ready to give up on BDD/TDD and, probably, Rails altogether.
Thanks for taking the time to read my complaints.
It's beyond me how the rails community can tolerate these wait times
You're right, those wait times are intolerable. No Rails developer in their right mind would put up with that. And they don't -- because hardly any Rails developers use Windows.
Do yourself a favor and stop knocking your head against the wall. Install Linux in VMWare or Virtualbox, load up Rails and RSpec/Cucumber, and compare. I think you'll have a much more enjoyable experience.
FWIW I run Ubuntu under VMWare on a E6600 2.4Ghz host running XP, and my times are much better than your quad core box.
btw if you can't be convinced to try the VM approach, check out the Rubymine IDE from JetBrains -- it does a decent job of running RSpec/Rails.
I have tried to work with RoR on Windows platform and it's really very slow (it's taken up to 40 seconds to rake db:init command) After I start use FreeBSD time of simmilar commands is about 10 seconds.
I personally didn't try Cucumber, but running 60 tests with Rspec2+ Spork+ Webrat - took 10 seconds on same hardware (without Virtual Machine)
I can't really say anything about Ruby development under Windows, but 45-60 seconds for a single test seems far too long. Although 4 GB should be enough, have you watched your memory while testing? Is there anything else running, consuming lots of memory or CPU (besides your OS ;) )?
You didn't mention anything about whether anti-virus software is running, but just in case:
I would verify that your anti-virus software isn't doing real-time checks on your files upon each test iteration. Perhaps you need to add your development directories to the exclusions list in the anti-virus software.
精彩评论