diff options
| author | 2019-01-14 01:40:56 -0500 | |
|---|---|---|
| committer | 2019-01-14 01:40:56 -0500 | |
| commit | dddfa903d2b856146f05ffb4415c31d6127bb5bf (patch) | |
| tree | e38c2aca92b54f06ccd0185f48dc47e3e1b3d77e /test/excelx/cell/test_datetime.rb | |
| parent | 8280a21a23d44aa90177e2bc041d0b8dc8556f4b (diff) | |
New upstream version 2.8.0upstream/2.8.0
Diffstat (limited to 'test/excelx/cell/test_datetime.rb')
| -rw-r--r-- | test/excelx/cell/test_datetime.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/excelx/cell/test_datetime.rb b/test/excelx/cell/test_datetime.rb index 425830b..4ab1e18 100644 --- a/test/excelx/cell/test_datetime.rb +++ b/test/excelx/cell/test_datetime.rb @@ -2,12 +2,12 @@ require 'test_helper' class TestRooExcelxCellDateTime < Minitest::Test def test_cell_value_is_datetime - cell = datetime.new('30000.323212', nil, ['mm-dd-yy'], nil, nil, base_date, nil) + cell = datetime.new('30000.323212', nil, ['mm-dd-yy'], nil, nil, base_timestamp, nil) assert_kind_of ::DateTime, cell.value end def test_cell_type_is_datetime - cell = datetime.new('30000.323212', nil, [], nil, nil, base_date, nil) + cell = datetime.new('30000.323212', nil, [], nil, nil, base_timestamp, nil) assert_equal :datetime, cell.type end @@ -19,7 +19,7 @@ class TestRooExcelxCellDateTime < Minitest::Test ['mmm-yy', 'JAN-15'], ['m/d/yy h:mm', '1/25/15 8:15'] ].each do |format, formatted_value| - cell = datetime.new '42029.34375', nil, [format], nil, nil, base_date, nil + cell = datetime.new '42029.34375', nil, [format], nil, nil, base_timestamp, nil assert_equal formatted_value, cell.formatted_value end end @@ -30,7 +30,7 @@ class TestRooExcelxCellDateTime < Minitest::Test ['h:mm:ss000 mm/yy', '8:15:00000 01/15'], ['mmm yyy', '2015-01-25 08:15:00'] ].each do |format, formatted_value| - cell = datetime.new '42029.34375', nil, [format], nil, nil, base_date, nil + cell = datetime.new '42029.34375', nil, [format], nil, nil, base_timestamp, nil assert_equal formatted_value, cell.formatted_value end end @@ -39,7 +39,7 @@ class TestRooExcelxCellDateTime < Minitest::Test Roo::Excelx::Cell::DateTime end - def base_date - Date.new(1899, 12, 30) + def base_timestamp + DateTime.new(1899, 12, 30).to_time.to_i end end |
