spec/cucumber/ast/table_spec.rb in aslakhellesoy-cucumber-0.3.0 vs spec/cucumber/ast/table_spec.rb in aslakhellesoy-cucumber-0.3.0.1
- old
+ new
@@ -19,10 +19,14 @@
it "should have columns" do
@table.columns[1].map{|cell| cell.value}.should == %w{four 55555}
end
+ it "should have headers" do
+ @table.headers.should == %w{one four seven}
+ end
+
it "should have same cell objects in rows and columns" do
# 666666
@table.cells_rows[1].__send__(:[], 2).should equal(@table.columns[2].__send__(:[], 1))
end
@@ -55,11 +59,11 @@
lambda {
@table.map_column!('two', true) { |v| v.to_i }
}.should raise_error('The column named "two" does not exist')
end
- describe ".transpose" do
+ describe "#transpose" do
before(:each) do
@table = Table.new([
%w{one 1111},
%w{two 22222}
])
@@ -68,10 +72,10 @@
it "should be convertible in to an array where each row is a hash" do
@table.transpose.hashes[0].should == {'one' => '1111', 'two' => '22222'}
end
end
- describe ".rows_hash" do
+ describe "#rows_hash" do
it "should return a hash of the rows" do
table = Table.new([
%w{one 1111},
%w{two 22222}