Created
January 18, 2012 00:53
-
-
Save damien/1630092 to your computer and use it in GitHub Desktop.
Cucumber table persistance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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