Cuke4duke: Using Transforms in features

18 views
Skip to first unread message

DJohnson

unread,
Sep 16, 2011, 3:25:29 PM9/16/11
to Cukes
I don't know if I'm blind or what, but I don't see any examples of
using cuke4duke transforms in features. "The Cucumber Book" shows a
transform being created and setup to be be constant an then used in a
feature step.

CAPTURE_CASH_AMOUNT = Transform/^\$(\d+)$/ do |digits|
digits.to_i
end

Given /^I have deposited (#{CAPTURE_CASH_AMOUNT}) in my account$/ do |
amount|
...
end

I can't figure out how to do this in Java with Cuke4duke, can someone
point me to an example? I haven't seen one anywhere.

Thanks,

David

aslak hellesoy

unread,
Sep 16, 2011, 4:22:48 PM9/16/11
to cu...@googlegroups.com
Hi David,

Numbers are automatically converted in Cuke4Duke - just declare your method arg as an int (or float, or double, or ...).

I tell everyone asking Cuke4Duke questions this. It's dead: http://groups.google.com/group/cukes/browse_thread/thread/299d94d38500e8c3

Aslak
 
Thanks,

David

--
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cu...@googlegroups.com.
To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.


DJohnson

unread,
Sep 16, 2011, 6:16:35 PM9/16/11
to Cukes
On Sep 16, 1:22 pm, aslak hellesoy <aslak.helle...@gmail.com> wrote:
>
> Hi David,
>
> Numbers are automatically converted in Cuke4Duke - just declare your method
> arg as an int (or float, or double, or ...).
> For more complex types there is an example here:https://github.com/cucumber/cuke4duke/blob/master/examples/java/src/t...

Thanks for the quick response, it is much appreciated, I'll look at
the example and go from there.

>
> I tell everyone asking Cuke4Duke questions this. It's dead:http://groups.google.com/group/cukes/browse_thread/thread/299d94d3850...
>
> Aslak
>

I am aware, but thanks for making sure that I know. The plan for this
project is to use Cuke4Duke until Cucumber-JVM is ready to go, I know
that you've said later this year, so I'm watching for that.

Thanks again,

David
Reply all
Reply to author
Forward
0 new messages