Hi Chris,

there is no explicit support for conditionality in GivenStories.

That said, GivenStories can be parametrised by meta (i.e. the meta properties are passed to the given story) and you could try using some bespoke meta info to execute or not certain stories, scenario or steps.

Bear in mind, though, that it's not very transparent and you risk losing a key benefit of BDD - the communication aspect.

Alternatively, still using meta, you can opt for a filtering solution, whereby certain stories are not executed depending on the filter you specify at runtime.

Feel free to put forward your usecases and we'll see if they can be better satisfied and if the case exists for new features.

Cheers

On 06/11/2012 05:48, Chris Geer wrote:
We are trying to use GivenStories to ensure prerequisite stories are run but are having a few problems. We really have a need to be able to declare a story as a given story on multiple stories but only have it run once, regardless of how many times it's declared. For example, we have a story that create a new user in the system, that if called multiple times causes errors, however we have multiple stories that require that user to be there. We'd like to be able to declare the createUser.story as a GivenStory for multiple other stories but also be able to mark it so that it's executed only once, kind of like a singleton story.

Is that possible today? If not, is there a good workaround? I also can't find a way to make a scenario/step/story run conditionally.

Thanks,
Chris


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to