Sha256: 02215251922bc4a4504ec00d015c092ac065afe93dc3e6aa2ff19c97c54d0512

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

require "watirspec"
require "spec/autorun"

describe Watir::TableRow do
  include WatiRspec::SpecHelper

  before :all do
    goto "http://dl.dropbox.com/u/2731643/misc/tables.html"
  end

  it "#to_a works with regular row" do
    first_row = table(:id => "normal")[1]
    first_row.to_a.should =~ %w[1 2 3]
  end

  it "#to_a works with headers in row" do
    first_row = table(:id => "headers")[1]
    first_row.to_a.should =~ %w[1 2 3 4]
  end

  it "#to_a works with nested tables" do
    second_row = table(:id => "nested")[2]
    second_row.to_a.should =~ [[%w[11 12], %w[13 14]], "3"]
  end

  it "#to_a works with deep-nested tables" do
    second_row = table(:id => "deepnested")[2]
    second_row.to_a.should =~ [[%w[11 12],
                                [[["404", "405"], ["406", "407"]], "14"]], "3"]
  end

  it "#to_a works with colspan" do
    second_row = table(:id => "colspan")[2]
    second_row.to_a.should == ["3"]
  end

  it "#to_a works with rowspan" do
    t = table(:id => "rowspan")
    second_row = t[2]
    second_row.to_a.should == ["3", "4"]

    third_row = t[3]
    third_row.to_a.should == ["5"]
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
watirspec-0.1.8 spec/watir_table_row_spec.rb
watirspec-0.1.7 spec/watir_table_row_spec.rb
watirspec-0.1.6 spec/watir_table_row_spec.rb
watirspec-0.1.5 spec/watir_table_row_spec.rb
watirspec-0.1.4 spec/watir_table_row_spec.rb
watirspec-0.1.3 spec/watir_table_row_spec.rb
watirspec-0.1.2 spec/watir_table_row_spec.rb