jnicklas/turnip — pull request #95 by quaternion (2013-05-02 12:53:17+00:00)
Title: added Table#map_column! method

Adds #map_column! method to Table class. This method iterates through the column and assigns it the value returned by the block. Is identical to the same method in the cucumber.
Scenario:
```gherkin
Scenario: ...
Given the following posts:
| user | article |
| Dave | post1 |
| John | post2 |
```
Step:
```ruby
step "the following posts:" do |table|
table.map_column!(:user) { |user| User.find_by_name!(name) }
table.hashes.each do |post|
create(:post, post)
end
end
```
This code raises error if column `user` does not exists in the scenario. If the user column is optional, use `map_column!` with `strict` option is false:
```ruby
table.map_column!(:user, false) { ... }
```