summaryrefslogtreecommitdiffstats
path: root/test/excelx/cell/test_time.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/excelx/cell/test_time.rb')
-rw-r--r--test/excelx/cell/test_time.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/excelx/cell/test_time.rb b/test/excelx/cell/test_time.rb
index 7619b3a..25d15f9 100644
--- a/test/excelx/cell/test_time.rb
+++ b/test/excelx/cell/test_time.rb
@@ -5,8 +5,8 @@ class TestRooExcelxCellTime < Minitest::Test
Roo::Excelx::Cell::Time
end
- def base_date
- Date.new(1899, 12, 30)
+ def base_timestamp
+ DateTime.new(1899, 12, 30).to_time.to_i
end
def test_formatted_value
@@ -18,13 +18,13 @@ class TestRooExcelxCellTime < Minitest::Test
['[h]:mm:ss', '[1]:48:09'],
['mmss.0', '4809.0'] # Cell::Time always get rounded to the nearest second.
].each do |style_format, result|
- cell = roo_time.new(value, nil, [:numeric_or_formula, style_format], 6, nil, base_date, nil)
+ cell = roo_time.new(value, nil, [:numeric_or_formula, style_format], 6, nil, base_timestamp, nil)
assert_equal result, cell.formatted_value, "Style=#{style_format} is not properly formatted"
end
end
def test_value
- cell = roo_time.new('0.0751', nil, [:numeric_or_formula, 'h:mm'], 6, nil, base_date, nil)
+ cell = roo_time.new('0.0751', nil, [:numeric_or_formula, 'h:mm'], 6, nil, base_timestamp, nil)
assert_kind_of Integer, cell.value
end
end