Skip to content

Instantly share code, notes, and snippets.

@michaeltwofish
Created March 15, 2011 02:13
Show Gist options
  • Save michaeltwofish/870204 to your computer and use it in GitHub Desktop.
Save michaeltwofish/870204 to your computer and use it in GitHub Desktop.
And the following clusters exist:
| id | name | description |
| 1 | Cluster 1 | Some description |
Given /^the following clusters exist:$/ do |clusters_table|
# item_table is a Cucumber::Ast::Table
item_table.hashes.each do |cluster|
insert_into_clusters(cluster)
end
end
# Generic step definition
Given /^the following [^\s]+ exist:$/ do |type, table|
# table is a Cucumber::Ast::Table
table.hashes.each do |hash|
send("insert_into_#{type}, hash)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment