[rspec-users] Reuse of Cucumber Features

Matt Wynne matt at mattwynne.net
Sun Dec 14 09:41:57 EST 2008


On 13 Dec 2008, at 20:58, Steve Molitor wrote:

> What's the best way to handle a requirement that shows up as a sub- 
> requirement requirement in other features?  For example let's say  
> users can enter dates in various forms throughout my application.    
> There is one set of global rules specifying the formats in which  
> dates may be entered, and how they are interpreted.  I put that in  
> one feature.  In various other features, like 'Create new patient',  
> one can enter dates, like the patient's birth date.  I want to do  
> something like 'and the date entry shall follow the normal rules'  
> but I'm not sure how to do that in an example driven way, without  
> copying and pasting from other features.
>
> Does my question make sense?  Any suggestions?

Do you know that you can call steps within steps?
http://blog.mattwynne.net/2008/11/14/dry-up-your-cucumber-steps/

Is that what you're looking for?

Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com



More information about the rspec-users mailing list