Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jt
Created May 31, 2011 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jt/999803 to your computer and use it in GitHub Desktop.
Save jt/999803 to your computer and use it in GitHub Desktop.
Cucumber tabular steps for tables and lists
Then /^(?:|I )should see the following table:$/ do |table|
table.diff! tableish("table tr", "td,th")
end
Then /^(?:|I )should see the following list:$/ do |table|
table.raw.each_with_index do |element, i|
page.should have_xpath("//li[#{i+1}][contains(normalize-space(.), '#{element.first}')]")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment