[rspec-users] testing out cucumber scenario outline feature

Joaquin Rivera Padron joahking at gmail.com
Sat Feb 7 14:25:26 EST 2009


hey thanks joseph,
I tried this out:
$ ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'tag
1.1.12'
$ ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r
'tag 1.1.12'

now Webrat finds correctly rspec-rails. Before it was a system gem and so it
failed, and all my
$ spec spec
were doing fine.

now with Examples as the keyword everything runs fine.

$ cucumber features/manage_cukes.feature
Feature: Manage cukes
  In order to use scenario outlines
  everything should work

  Scenario Outline: Testing scenario outlines #
features/manage_cukes.feature:5
    Given there are <cuke_versions>

  Examples:
    | cuke_versions  |
    | cuke_version 1 |
    | cuke_version 2 |
    | cuke_version 3 |
    | cuke_version 4 |

4 scenarios
4 undefined steps

You can implement step definitions for missing steps with these snippets:

Given /^there are cuke_version 1$/ do
  pending
end

Given /^there are cuke_version 2$/ do
  pending
end

Given /^there are cuke_version 3$/ do
  pending
end

Given /^there are cuke_version 4$/ do
  pending
end

the thing was I was expecting the step like this:

Given /^there are <cuke_versions>$/ do
  cuke_version.should_not be_nil
end

and then the step get called 4 times with the right data each time. But the
wiki states "*IMPORTANT: Your step definitions will never have to match a
placeholder. They will need to match the values that will replace the
placeholder*" so its a feature.

Then I must be missing the purpose of it. I'll dive the code and see...

thanks
joaquin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090207/f5f162e6/attachment.html>


More information about the rspec-users mailing list