Sha256: c2e86b9d654eb7f6e6f4955ed12e2a609b0a3027634807830e84053dcd771cee

Contents?: true

Size: 690 Bytes

Versions: 8

Compression:

Stored size: 690 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

module Cucumber
  module Model
    describe Table do
      before do
        @raw = [
          %w{name gender},
          %w{aslak male},
          %w{patty female},
          ]
      end

      it "should convert into hash-array" do
        ha = Table.new(@raw).hashes
        ha.should == [
          {'name' => 'aslak', 'gender' => 'male'},
          {'name' => 'patty', 'gender' => 'female'}
        ]
      end
      
      it "should return the rows of the table" do
        ar = Table.new(@raw).rows
        ar.should == [
          ["aslak", "male"],
          ["patty", "female"]
        ]
      end
      
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
aslakhellesoy-cucumber-0.1.16.1 spec/cucumber/model/table_spec.rb
aslakhellesoy-cucumber-0.1.16.2 spec/cucumber/model/table_spec.rb
aslakhellesoy-cucumber-0.1.16.3 spec/cucumber/model/table_spec.rb
aslakhellesoy-cucumber-0.1.16.4 spec/cucumber/model/table_spec.rb
aslakhellesoy-cucumber-0.1.16 spec/cucumber/model/table_spec.rb
kosmas58-cucumber-0.1.16.5 spec/cucumber/model/table_spec.rb
kosmas58-cucumber-0.1.16.6 spec/cucumber/model/table_spec.rb
cucumber-0.1.16 spec/cucumber/model/table_spec.rb