Stubs and Mocks in cfSpec 0.3
I noticed last week that there is a new version of cfSpec available and took the oportunity to download it.
I was very keen to try out the new Mocking feature as a new project I started needs to be able to do that because the web services it will be using won't be available until after the project has been underway for several weeks. 'Great,' I thought, I can start straight away and use Mocks for the missing web services.
Unfortunately there is no documentation yet, but Ron Hopper very kindly sent me a document that helped me get started with writing some simple Mocks and this week I should be able to nail down some more realistic ones for my project.
The new version of cfSpec builds upon the great work done in earlier versions with Stubs, so using a Mock is very similar but gives you extra abilities to set what the object returns and test how many times it is called. So let's start with some examples of stubs which worked in version 0.2.


