spec/cucumber/ast/table_spec.rb in cucumber-0.4.2 vs spec/cucumber/ast/table_spec.rb in cucumber-0.4.3
- old
+ new
@@ -391,10 +391,20 @@
def table(text, file=nil, line_offset=0)
@table_parser ||= Parser::TableParser.new
@table_parser.parse_or_fail(text.strip, file, line_offset)
end
end
-
+
+ describe "#new" do
+ it "should allow Array of Hash" do
+ t1 = Table.new([{'name' => 'aslak', 'male' => 'true'}])
+ t1.to_s(:indent => 12, :color => false).should == %{
+ | name | male |
+ | aslak | true |
+ }
+ end
+ end
+
it "should convert to sexp" do
@table.to_sexp.should ==
[:table,
[:row, -1,
[:cell, "one"],