[rspec-users] DRYing up stories

aslak hellesoy aslak.hellesoy at gmail.com
Wed Jan 23 18:37:46 EST 2008


On Jan 23, 2008 10:45 PM, Neil M. Young <ermok at tiscali.co.uk> wrote:
>
> I'm finding that I'm writing sets of very similar scenarios to check access
> permissions for each of my actions. Does anyone have suggestions on how to
> dry this up:
>

Beware that DRY has a cost. Clarity and readability.

David's BDD manifesto (slightly rephrased):

We prefer clarity over DRY (that is - while there is value in DRYness,
we value clarity more)

Aslak

> Given an existing Account
> And a logged in Admin
> When the user visits account/manage
> Then he should get access
>
> Given an existing Account
> And a logged in Manager
> When the user visits account/manage
> Then he should get access
>
> Given an existing Account
> And a logged in Supervisor
> When the user visits account/manage
> Then he should not get access
>
> Given an existing Account
> And a logged in Reviewer
> When the user visits account/manage
> Then he should not get access
>
> Given an existing Account
> And a logged in User
> When the user visits account/manage
> Then he should not get access
>
> --
> View this message in context: http://www.nabble.com/DRYing-up-stories-tp15053384p15053384.html
> Sent from the rspec-users mailing list archive at Nabble.com.
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list