Closed bjoernbur closed 11 years ago
@senny what do you think about that? a started with the idea of comparing a Cucumber::Ast::Table
with a CornerStones::Table
like this:
co_table = CornerStones::Table.new("table_selector")
co_table.equals?(expected_cucumber_table).should == true
but if we do so, we have a dependency on cucumber... what do you think?
What does this PR add over:
ast_table.diff! corner_stones_table.rows
When I do this I get the following error:
can't convert CornerStones::Table::Row into Array (TypeError)
Ah completely forgot the refactoring on master
that #rows
no longer returns an array of hashes. This was introduced with: https://github.com/senny/corner_stones/commit/a0cd3ccb82e806ddc36e1271803d661cadfb97fa
I would still use the ast_table.diff!
method though. It creates the nice colored output in the cucumber scenarios. My suggestion would be to create a method called Table#hashes
, which converts the rows to attributes and returns the old style Array of Hashes. This would then look like:
ast_table.diff! corner_stones_table.hashes
Let me know if you want to update the PR.
Looks good to me...
I'll update the PR asap...
Thanks by the way :+1:
@senny I changed the PR: now there's a hashes
-method. this method returns an array with the attribute-hash of each row.
thanks! :yellow_heart:
As a developer I would like to compare the data of a
CornerStones::Table
with the data of aCucumber::Ast::Table
.At the moment I have to do the following:
With this PR I can do: