Sunday, January 27, 2008

Merb Supports rSpec Text Stories

Today I managed to release a new plugin for merb that provides basic support for rSpecs text stories. It's a bit experimental at the moment so if you want to pitch in and get it going smooth, come on down ;)

I have been hanging onto it for a little while, but I keep trying to get into the release early and often philosophy.

Get It

Like all merb plugins, this one is a gem. You can get it from gem
sudo gem install merb_stories
You can get it from source
svn checkout svn://
cd merb_stories
rake install


At it's heart merb_stories is almost just a generator, but you do need to add it as a dependency to get going with it. You can safely remove it when you deploy, but for now it needs to be there to run the stories.

Generate A Story

In your Merb.root
ruby script/generate story my_story
This will generate all the support files, if they're missing, and also the story, story steps etc.

If you want to organise your stories a bit more, you can put them into sub-directories.
ruby script/generate story story_group/story
You can go as deep as you like with the directories.

Running Your Stories

It's really simple to run your stories. merb_stories supplies a rake task to remove any pain you might have.
rake story[my_story]
or if you used subdirectories
rake story[story_group/my_story]
You can also just run all of them at once.
rake story[all]

Thats really about all there is to it. To check out what to use stories for checkout the rSpec site.