Forum: RSpec [Cucumber] Tabular data in steps

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F1e1789ff9e7fc3032fa6cf15382a1e8?d=identicon&s=25 Juanma Cervera (jmcervera)
on 2009-01-29 09:47
Is it possible to mix a normal parameter argument for a step, with
tabular data?

Something like this:

Given there is a country "Spain" with the cities:
  |name      |
  |Madrid    |
  |Barcelona |
  |Valencia  |

And this step_definition

Given /^there is a country "Spain" with the cities:$/ do |country_name,
cities_table|
...
end

Thanks
Juanma
B56c79aacc04f148f4205e0ff308b39a?d=identicon&s=25 Erik Pukinskis (Guest)
on 2009-01-29 10:42
(Received via mailing list)
Yes, that should work.  But you'd have to do

Given /^there is a country "(.*)" with the cities:$/ do |country_name,
cities_table|
...
end

Erik
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-01-29 12:37
(Received via mailing list)
On Thu, Jan 29, 2009 at 10:37 AM, Erik Pukinskis
<erikpukinskis@gmail.com> wrote:
> Yes, that should work.  But you'd have to do
>
> Given /^there is a country "(.*)" with the cities:$/ do |country_name,
> cities_table|
> ...
> end
>

Correct. And it's documented in the Wiki:
http://wiki.github.com/aslakhellesoy/cucumber/call...

Aslak
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-01-29 12:42
(Received via mailing list)
On Thu, Jan 29, 2009 at 12:29 PM, aslak hellesoy
<aslak.hellesoy@gmail.com> wrote:
> Correct. And it's documented in the Wiki:
> http://wiki.github.com/aslakhellesoy/cucumber/call...
>

Actually - this is more relevant in your case:
http://wiki.github.com/aslakhellesoy/cucumber/usin...

Aslak
F1e1789ff9e7fc3032fa6cf15382a1e8?d=identicon&s=25 Juanma Cervera (jmcervera)
on 2009-01-29 13:17
Aslak

The documentation in this wiki is the best I have ever seen, and it's
constantly being improved.

Very good job
and thanks.

Juanma
This topic is locked and can not be replied to.