summaryrefslogtreecommitdiffstats
path: root/test/excelx/cell/test_time.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:40:56 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:40:56 -0500
commitdddfa903d2b856146f05ffb4415c31d6127bb5bf (patch)
treee38c2aca92b54f06ccd0185f48dc47e3e1b3d77e /test/excelx/cell/test_time.rb
parent8280a21a23d44aa90177e2bc041d0b8dc8556f4b (diff)
New upstream version 2.8.0upstream/2.8.0
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