[rspec-users] Cucumber - Adding a step definition

aslak hellesoy aslak.hellesoy at gmail.com
Fri Mar 13 17:47:05 EDT 2009


On Fri, Mar 13, 2009 at 10:28 PM, Tim Hart <THart at picagroup.com> wrote:

> List,
>
> 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.
>

Unfortunately, this only aliases the ruby methods (this will let you call
With /some step/ do..end in a step definition ruby file.
In order to make the plain text parser recognise other words, a change is
needed in languages.yml.

If you add a feature request in Lighthouse I'll see if I can add it.

Cheers,
Aslak


>
> Suggestions?
> --
> Tim Hart
> Senior Software Engineer
> PICA Group
> 615-713-9956 :cell
> timothyjhart :Y!
> 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
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
Aslak (::)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090313/642a4949/attachment.html>


More information about the rspec-users mailing list