Skip to content

Instantly share code, notes, and snippets.

@damien
Created January 18, 2012 00:53
Show Gist options
  • Select an option

  • Save damien/1630092 to your computer and use it in GitHub Desktop.

Select an option

Save damien/1630092 to your computer and use it in GitHub Desktop.
Cucumber table persistance
Feature: Table persistence
Scenario: We try to modify a table and it keeps its changes when we pass it to another step
When we have the following table and then set an arbitrary value inside the step definition
| one | 1 |
| fizz | buzz |
Then the table should retain this modification when passed to another step
When /^we have the following table and then set an arbitrary value inside the step definition$/ do |table|
table.hashes.first[:foo].should == nil
table.hashes.first.update(:foo => :bar)
table.hashes.first[:foo].should == :bar
step "the table won't retain this modification when passed to another step", table
end
When /^the table should retain this modification when passed to another step$/ do |table|
table.hashes.first[:foo].should == :bar
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment