[rspec-users] RSpec makes me want to write better code

Fernando Perez lists at ruby-forum.com
Tue Mar 31 10:13:09 EDT 2009

> By "getting", do you mean new controllers arrive skinny? Or that you 
> have
> refactored the same fat controllers, over time, until they are skinny?
> The latter is preferred, because we should not be writing the same sites 
> over
> and over again. In theory!

My good ole' fat pig controllers, are now nice, slim and fancy :-)

> How often do you run your tests? Your editor should help you run them 
> after
> every couple of edits. A lot of BDD is actually "cargo cult" 

It depends. Overall I try to take small steps at a time. But never ever 
will I update the server code unless 100% specs pass!

> But you should _want_ to test every few edits. More important, you 
> should be
> able to correctly predict the result of each run.
As a habit I like to abuse of the save button even if I only corrected 
some typos in comments, or changed the indentation. Suddenly autotest 
would kick in for nothing.

Sometimes I save 4 files one after the other because I forgot about the 
keyboard short cut for saving them all at once, and autospec will run 4 
times instead of only once which is stupid. And growl will be notifying 
me each time which is very distracting.
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list