Examples of Behaviour Spec'n
June 30th, 2008
In my previous post (Spec Behaviour not Implementation) I went on a froth roll about why you should treat controller actions as black boxes. Here I give an all to common example of why this is good and how you can write specs that won’t break at the most trivial change.
Read the rest of this entryTip #27 - Spec a Behaviour, Not an Implementation
June 28th, 2008
This has been said a lot, and doesn’t really need repeating by someone like me, but, as this is a tips page, I should put it here.
Read the rest of this entryTip #26 - Start Small
June 27th, 2008
If you are getting frustrated with RSpec, then you have probably skipped a gradient. Start smaller!
Read the rest of this entryTip #25 - Logging is your friend...
June 26th, 2008
Sometimes when you need someone to just look over your code and figure out what the heck is going on, you can turn to your best coding friend, this friend sits away in the log directory carefully collecting data waiting for your beck and call…
Read the rest of this entryTip #24 - Being clever in specs is for dummies
June 25th, 2008
This tip is coming to you from a frustrated developer having to read someone else’s specs….
Read the rest of this entryRSpec Story xhr problem
June 6th, 2008
If you are using RSpec stories (and if you are not, why not?) you might run into this little problem. doing an xhr :post returns ArgumentError: wrong number of arguments (4 for 3)
Read the rest of this entryTip #16 - Valid Models Don't Have to be Hard
May 12th, 2008
If you are using BE DE DE or TE DE DE, then you will get situations in your specs or tests where you want to be able to just create a valid model of another type to test against. This is where factories and builders come in handy.
Read the rest of this entrySaving TMail into an ActiveRecord model
November 23rd, 2007
ActiveRecord works well when we are saving strings and integers, but what if you want to save a real, live, honest-to-God Ruby OBJECT like a TMail::Mail instance?? Well.. serialize to the rescue!
Read the rest of this entryKeep RSpec Current
November 17th, 2007
I like living on the edge with RSpec. It actually is not so bad. Every week or so I do an update on the trunk, but this is a few steps that should be automated, this is how you do it.
Read the rest of this entryRSpec Textmate Bundle Troubles
November 16th, 2007
I love RSpec, I love textmate… but sometimes… they just don’t love each other…
Read the rest of this entryWhy use lambda in RSpec?
November 15th, 2007
RSpec allows you to write nice readable tests… and some little tricks make it even nicer! And I don’t know about you, but the word lambda is (1) ugly, (2) means basically bugger all and (3) is hard to pronounce late at night… so lets replace it!
Read the rest of this entry