[rspec-users] Cucumber - Adding a step definition

Tim Hart THart at picagroup.com
Sat Mar 14 18:01:21 EDT 2009

On Mar 14, 2009, at 3:38 PM, "Andrew Premdas" <apremdas at gmail.com<mailto:apremdas at gmail.com>> wrote:

Is the syntax you're using a misreading of the wiki advice on Feature-Coupled Steps.

Why not have

"GIven a policy with a PCF practice state and seconday risk"

Because the work we are currently doing is going to involve several hundred different variations of over a hundred different attributes of a policy. I need to make sure that I'm able to reuse as many statements describing that policy as I possibly can.

Another factor is that our SME is going to be heavily involved in creating these scenarios. A few concessions toward regular English will help a great deal.

This is not a featured coupled step because PCF practice state and secondary risk are part of the Policies state and are not seperate. Seperating the step as you have done does not reduce coupling. In fact all it does is complicate the steps because a variable containing the policy has to now be in the 3 steps.

Perhaps the need for a with is a 'smell' suggesting that you are seperating a step that is intrinsically coupled. So with really shouldn't be needed at all.



2009/3/13 Tim Hart <<mailto:THart at picagroup.com>THart at picagroup.com<mailto:THart at picagroup.com>>

Quick question about Cucumber/Gherkin.

I'm considering adding 'With' as a step definition to support scenarios like:

Given a policy
With a PCF practice state
And a secondary risk

I'm fairly new to ruby - but I can't quite get this one figured out. I've tried adding

Cucumber.alias_steps (['With'])

To my features/support/env.rb file, but when I run cucumber, I still get a Syntax error. It looks like my 'with' never gets added to the original list.

Tim Hart
Senior Software Engineer
PICA Group
615-713-9956 :cell
timothyjhart :Y!
<mailto:tjhart at me.com>tjhart at me.com<mailto:tjhart at me.com> :AIM


Disclaimer: This electronic message may contain information that is Confidential or legally privileged. It is intended only for the use of the individual(s) and entity named in the message. If you are not an intended recipient of this message, please notify the sender immediately and delete the material from your computer. Do not deliver, distribute or copy this message and do not disclose its contents or take any action in reliance on the information it contains.


rspec-users mailing list
<mailto:rspec-users at rubyforge.org>rspec-users at rubyforge.org<mailto:rspec-users at rubyforge.org>

rspec-users mailing list
rspec-users at rubyforge.org<mailto:rspec-users at rubyforge.org>

More information about the rspec-users mailing list