[rspec-users] DRYing up stories
marcus at ahnve.com
Sun Jan 27 16:54:15 EST 2008
On Thu, Jan 24, 2008 at 08:25:49AM +0100, aslak hellesoy wrote:
> On Jan 24, 2008 1:04 AM, Ben Mabey <ben at benmabey.com> wrote:
> > While the original post had DRY in the subject line I don't see this as
> > a DRY issue. I see it as a visualization and maintenance issue. If I
> > add a new role and I want to test each action for it's permissions it
> > would be much easier for a customer to go down a spread sheet and
> > designate within each cell what the response should be.. success or
> > failure, etc... This would give the customer a bird's eye view of
> > permissions for the entire app for each class of users. By using a
> > separate scenario for each role in each story you will be creating a lot
> > of copy and past work which will comminucate the same information a
> > spreadsheet would but a lot more inefficently since someone would have
> > to read hundreds of pages of stories. I love the plain text stories.
> > We just have to remember that there are better ways to express large
> > amounts of data than plain English. :)
> > Do you understand the point I'm trying to make?
> I totally get your point. This is where FIT shines (or maybe Ryan's Matrix).
I completely agree. My experience is that you most often end up with two
types of specs: flows and rules. Flows are best described in a story
format, whereas rules are best described in a clear table format.
Just take a simple password rule. Using flows to do this is overly
verbose compared to fit. For example:
|short |false |
And of course flows are not well documented using Fit. That is my basic
theory for why it never took of.
I have spent an hour or two trying to write a story runner for Fit, so
far mostly reading the arcane Ruby Fit library. I'll get back when I
have something to show.
More information about the rspec-users