I have no idea if this will work, but you could try to sense for the
table row you want to skip in a Before block, then call skip_invoke!
Well, this isn’t really working (or I might forgot something to define,
but from http://wiki.github.com/aslakhellesoy/cucumber/hooks - it seems
that ‘Before’ is operating with tags (and hooks) - see
This is in fact be useful, because we are able execute code before each
line of the properly tagged Scenario Outline… but… I still don’t
know the method/variable to access the current line of the example
So translated into the code, an example:
Scenario Outline: file reader
Given I read
Then I want to have
| file | content |
| x.txt | Text |
| y.txt | Other text |
how to access current row???
if row == $external_filename
# how to properly skip current line???
Given /I read (.+)/ do |fileName|
#open and read fileName
Then /I want to have (.+)/ do |content|
#assert ‘content’ against @file_content
So we need something for ‘row’ and a proper way to skip the current
I now that this example is not a good real life situation (it would be
easier to use multiline step arguments), but we would like to use
Cucumber driven by an external source (executing only one line from each
example table) AND maintaining the ability to run it independently (all
I hope this cleared up the things a bit more…
Thanks for your ideas!