Sha256: 57659a82353f8a475c322ed7c034a68ac0be5c5e77d7e523a86f13b799605a73

Contents?: true

Size: 888 Bytes

Versions: 7

Compression:

Stored size: 888 Bytes

Contents

require 'spec/spec_helper'
require 'taza/page'
require 'taza/site'
require 'spec/fake_table'

describe FakeTable do
  
  it "has rows" do
    @fake_table = FakeTable.new [{},{}]
    @fake_table.rows.length.should == 2
  end
  
  it "has fake rows" do
    @fake_table = FakeTable.new [{:name => 'apple'}]
    @fake_table.rows[0].should be_a(FakeRow)
  end    

  # Note: the way it fakes out elements is the least
  # authentic aspect of this scheme
  it "has rows with elements and display values" do
    @fake_table = FakeTable.new [{:name => 'apple'}]
    @fake_table.rows[0].element(:name).display_value.should == 'apple'
  end
  
  it "has rows with elements that can be set" do
    @fake_table = FakeTable.new [{:name => 'apple', :color => 'blue'}]
    @fake_table.rows[0].element(:color).set 'red'
    @fake_table.rows[0].element(:color).display_value.should == 'red'
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bret-watircraft-0.4.0 spec/table_spec.rb
bret-watircraft-0.4.1 spec/table_spec.rb
bret-watircraft-0.4.2 spec/table_spec.rb
bret-watircraft-0.4.3 spec/table_spec.rb
bret-watircraft-0.4.4 spec/table_spec.rb
bret-watircraft-0.4.5 spec/table_spec.rb
bret-watircraft-0.5.0 spec/table_spec.rb