summaryrefslogtreecommitdiffhomepage
path: root/test/workbook
diff options
context:
space:
mode:
authorJonathan Tron <[email protected]>2015-07-04 12:22:37 +0200
committerJonathan Tron <[email protected]>2015-07-04 12:22:37 +0200
commit2c2cb92009bd3c1d73b24fc4ffd71d3bacb0102b (patch)
tree481a3513d11db2928335d5a32dbdee17bc98b596 /test/workbook
parent72212c1f4033ae2de83253306a246b5161e07428 (diff)
parent5da13d60508f0ebacb3ba5afd3d29eb00c7ca59e (diff)
downloadcaxlsx-2c2cb92009bd3c1d73b24fc4ffd71d3bacb0102b.tar.gz
caxlsx-2c2cb92009bd3c1d73b24fc4ffd71d3bacb0102b.zip
Merge branch 'fix-time-cast' of https://github.com/soutaro/axlsx into soutaro-fix-time-cast
Diffstat (limited to 'test/workbook')
-rw-r--r--test/workbook/worksheet/tc_cell.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb
index f9761330..5ae2a51f 100644
--- a/test/workbook/worksheet/tc_cell.rb
+++ b/test/workbook/worksheet/tc_cell.rb
@@ -119,6 +119,19 @@ class TestCell < Test::Unit::TestCase
assert_equal("2012-10-10T12:24", @c.send(:cast_value, "2012-10-10T12:24"))
end
+ def test_cast_time_subclass
+ subtime = Class.new(Time) do
+ def to_time
+ raise "#to_time of Time subclass should not be called"
+ end
+ end
+
+ time = subtime.now
+
+ @c.type = :time
+ assert_equal(time, @c.send(:cast_value, time))
+ end
+
def test_color
assert_raise(ArgumentError) { @c.color = -1.1 }
assert_nothing_raised { @c.color = "FF00FF00" }