Skip to content

Commit

Permalink
Table#map_column! returns the table object
Browse files Browse the repository at this point in the history
  • Loading branch information
rbxbx committed Dec 15, 2010
1 parent 0f70ff3 commit 0af3ff8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/cucumber/ast/table.rb
Expand Up @@ -278,6 +278,7 @@ def map_headers(mappings={})
def map_column!(column_name, strict=true, &conversion_proc)
verify_column(column_name.to_s) if strict
@conversion_procs[column_name.to_s] = conversion_proc
self
end

# Compares +other_table+ to self. If +other_table+ contains columns
Expand Down
4 changes: 4 additions & 0 deletions spec/cucumber/ast/table_spec.rb
Expand Up @@ -67,6 +67,10 @@ def @table.columns; super; end
}.should raise_error('The column named "two" does not exist')
end

it "should return the table" do
(@table.map_column!(:one) { |v| v.to_i }).should == @table
end

describe "#match" do
before(:each) do
@table = Table.new([
Expand Down

0 comments on commit 0af3ff8

Please sign in to comment.