Monthly Archives: August 2010

getting started with acts_as_state_machine

This is a note to self. Remember to define all states for an object before you start referencing it.

If not, you will get an error like this:

“You have a nil object when you didn’t expect it! The error occurred while evaluating nil.entering”

Posted in programming, Ruby programming, software engineering | Tagged , , , , , | Leave a comment

how to stub methods in cucumber

Most of the Cucumber tests that I’ve written don’t need stubbing. But the other day I was trying to test a particular feature which integrated with an external service. Then, stubbing a call to the external service seemed like the best way to go. Fortunately, since Cucumber 0.8.4, mocking and stubbing is now possible without [...]

Posted in open source, programming, Ruby programming, software engineering | Tagged , , , | Leave a comment