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.
Juanma C. (Guest)
on 2009-01-29 10: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
Erik P. (Guest)
on 2009-01-29 11: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
Aslak H. (Guest)
on 2009-01-29 13:37
(Received via mailing list)
On Thu, Jan 29, 2009 at 10:37 AM, Erik P.
<removed_email_address@domain.invalid> 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
Aslak H. (Guest)
on 2009-01-29 13:42
(Received via mailing list)
On Thu, Jan 29, 2009 at 12:29 PM, aslak hellesoy
<removed_email_address@domain.invalid> 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
Juanma C. (Guest)
on 2009-01-29 14: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.