Sha256: 4134964c5cbfe8c1c4a5b42d433b0d31bdd7d57e573cf109bc6536f4ab9b7f63

Contents?: true

Size: 872 Bytes

Versions: 25

Compression:

Stored size: 872 Bytes

Contents

#!/usr/bin/env ruby
# Excel::TestRow -- Spreadsheet -- 12.10.2008 -- hwyss@ywesee.com

$: << File.expand_path('../../lib', File.dirname(__FILE__))

require 'test/unit'
require 'spreadsheet'

module Spreadsheet
  module Excel
class TestRow < Test::Unit::TestCase
  def setup
    @workbook = Excel::Workbook.new
    @worksheet = Excel::Worksheet.new
    @workbook.add_worksheet @worksheet
  end
  def test_date
    row = Row.new @worksheet, 0, [nil, 27627.6789]
    assert_equal Date.new(1975,8,21), row.date(1)
  end
  def test_datetime
    row = Row.new @worksheet, 0, [nil, 27627.765]
    d1 = DateTime.new(1975,8,21) + 0.765
    d2 = row.datetime 1
    assert_equal d1, d2
  end
  def test_datetime_overflow
    row = Row.new @worksheet, 0, [nil, 40010.6666666666]
    d1 = DateTime.new(2009,07,16,16)
    d2 = row.datetime 1
    assert_equal d1, d2
  end
end
  end
end

Version data entries

25 entries across 25 versions & 5 rubygems

Version Path
nulogy-spreadsheet-0.6.5.7.4 test/excel/row.rb
spreadsheet-0.7.3 test/excel/row.rb
spreadsheet-0.7.2 test/excel/row.rb
spreadsheet-0.7.1 test/excel/row.rb
spreadsheet-0.7.0 test/excel/row.rb
spreadsheet-0.6.9 test/excel/row.rb
spreadsheet-0.6.8 test/excel/row.rb
spreadsheet-0.6.7 test/excel/row.rb
nulogy-spreadsheet-0.6.5.7.3 test/excel/row.rb
nulogy-spreadsheet-0.6.5.7.2 test/excel/row.rb
spreadsheet-martica-0.6.5.7.m2 test/excel/row.rb
spreadsheet-martica-0.6.5.7.m1 test/excel/row.rb
ttb-spreadsheet-0.6.5.8 test/excel/row.rb
spreadsheet-0.6.5.9 test/excel/row.rb
spreadsheet-0.6.5.8 test/excel/row.rb
spreadsheet-0.6.5.7 test/excel/row.rb
spreadsheet-0.6.5.6 test/excel/row.rb
spreadsheet-0.6.5.5 test/excel/row.rb
spreadsheet-0.6.5.4 test/excel/row.rb
spreadsheet-0.6.5.3 test/excel/row.rb