[rspec-users] Story runner "macros"

Rick DeNatale rick.denatale at gmail.com
Mon Jan 21 00:09:34 EST 2008

I've gotten quite a bit out of Pat Maddox's screencast

One thing I'm not sure of is the feature where he writes things like:

   When "I POST to", "/articles", :post => {:title => "Title", :body
=> "Body") do | path, params|
        post_via_redirect path, params

This bothers me because it seems an abrupt level jump.  Most of the
stories are written at a level where the goal donor can understand
them, For example, I'm pretty sure that the above when clause started
life as somethign more like

     When "I add an article"

I actually changed Pat's example a bit to use article instead of post
to keep the domain and implementation nouns different.  I'd say that
the "add an article" form is easily understood by a client, but the
"POST to ", ... form is not.

When I try the parameterized form, I notice that the story runner only
reports the story as

   When I post to

So the output is even less useful for talking to the client.

Now I really like the idea of the parameterized stories, but the step
away from client-speak makes me shy away from them.  Is there a way to
get the power without loosing the intelligibility?

Rick DeNatale

My blog on Ruby

More information about the rspec-users mailing list