Plain Text Stories at DCRUG

I attended possibly my last DCRUG before my wife and I relocate to just outside of Ocean City, MD. Paul Barry gave a rehash of his Merb presentation from NoVaRUG from a few months ago. I presented on plain text stories.

I had initially planned to only talk about RSpec Plain Text Stories. However, I’d had researching Cucumber on my mental TODO list (shame on me for not having it in my trusted repository; GTD FAIL) so I took the opportunity to indulge.

And to excellent effect.

Cucumber seems to make up for most of the deficiencies in RSpec Plain Text Stories (see slides for more details). However, one seeming flaw that numerous members of the audience and I all found is that substitution points/arguments/parameters are specified in the code via regexp but not in the plain text.

For instance:

  Given a prerequisite of some kind
  When I do something
  Then some expectation should be met

  | prereq | action | test  |
  | Foo    | bar    | blech |

… does not indicate to the reader where Foo, bar, and blech will be substituted into the Scenario. Everyone homed in on this seeming weakness.

The general consensus at DCRUG seemed to be that something akin to the below would make more sense:

  Given a prerequisite prereq
  When I do action
  Then test should be met

  | prereq | action | test  |
  | Foo    | bar    | blech |

… seems a simpler alternative. Also that the Scenario, as described above, would only execute once using the FIT table at the bottom for parameters. The Scenario, as declared in the second example, becomes a template of sorts.

I hope to reach Aslak to discuss this. Cucumber looks like a huge step in the right direction in every other respect.

Plain Text Stories presentation

Posted by evan on Thursday, September 11, 2008

blog comments powered by Disqus