Composed Stories/Scenarios

In using stories, I find myself wanting to build scenarios on top of
each other,

For example

I want something like

Scenario: The user logs on
Given a
And b
When c
And d
Then e
And f

Scenario: The user changes his password
Given the user logs on
And g
Then h

In other words, I’d like to write the second scenario starting with
the ‘state’ produced by the first. I’d like to ‘invoke’ a scenario in
a Given or When clause. I think that this should mean that the Given
and When clauses of the scenario being invoked would be inserted/run
at this point. The Then clauses wouldn’t I would think since these
are ‘tested’ when the original scenario is run.

Does this make sense? How have others dealt with this?

This is probably at tension with the XP notion of stories being
minimal and isolated, but RBehave/RSpec stories already seem to have
that tension IMHO.

Thoughts?


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On Tue, Mar 11, 2008 at 12:14 PM, Rick DeNatale
[email protected] wrote:

And d
a Given or When clause. I think that this should mean that the Given
and When clauses of the scenario being invoked would be inserted/run
at this point. The Then clauses wouldn’t I would think since these
are ‘tested’ when the original scenario is run.

Does this make sense? How have others dealt with this?

This is probably at tension with the XP notion of stories being
minimal and isolated, but RBehave/RSpec stories already seem to have
that tension IMHO.

This is already supported - use GivenScenario like this:

Scenario: The user changes his password
GivenScenario: The user logs on
And g
Then h

This only works within the same story.

Cheers,
David

On 3/11/08, David C. [email protected] wrote:

When c
the ‘state’ produced by the first. I’d like to ‘invoke’ a scenario in

This only works within the same story.
Cool!


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/