Sha256: dfecbb7c570e16d0fbcd0e499e3944f73bfae8b5de2ef03a177beca14f7407e4

Contents?: true

Size: 776 Bytes

Versions: 1

Compression:

Stored size: 776 Bytes

Contents

require 'dullard'

describe "dullard" do
  before(:each) do
    @file = File.open(File.expand_path("../test.xlsx", __FILE__))
    @xlsx = Dullard::Workbook.new @file
  end
  it "can open a file" do
    @xlsx.should_not be_nil
  end

  it "can find sheets" do
    @xlsx.sheets.count.should == 1
  end

  it "reads the right number of columns, even with blanks" do
    rows = @xlsx.sheets[0].rows
    rows.next.count.should == 300
    rows.next.count.should == 9
    rows.next.count.should == 1
  end

  it "reads the right number of rows" do
    count = 0
    @xlsx.sheets[0].rows.each do |row|
      count += 1
    end
    count.should == 115
  end

  it "reads the right number of rows from the metadata when present" do
    @xlsx.sheets[0].rows.size.should == 115
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dullard-0.0.5 specs/dullard_spec.rb