diff options
| author | Randy Morgan <[email protected]> | 2013-01-15 21:53:03 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2013-01-15 21:53:03 +0900 |
| commit | e14682fb484cd72ba5f479cc1f7d46a7a9fd6007 (patch) | |
| tree | fd5a6efd273caebcb5ad4e6be66d0639e37cfcc7 /test/workbook/worksheet/tc_cell.rb | |
| parent | bd099af6f8fe954eabc1db33c9ad3990629ddff1 (diff) | |
| download | caxlsx-e14682fb484cd72ba5f479cc1f7d46a7a9fd6007.tar.gz caxlsx-e14682fb484cd72ba5f479cc1f7d46a7a9fd6007.zip | |
Added support for iso 8601 data types.
Not really sure what excel is going to do with these data types, but
hooking it up is the first step ;)
Diffstat (limited to 'test/workbook/worksheet/tc_cell.rb')
| -rw-r--r-- | test/workbook/worksheet/tc_cell.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb index b237077c..208b15e0 100644 --- a/test/workbook/worksheet/tc_cell.rb +++ b/test/workbook/worksheet/tc_cell.rb @@ -89,6 +89,7 @@ class TestCell < Test::Unit::TestCase assert_equal(@c.send(:cell_type_from_value, true), :boolean) assert_equal(@c.send(:cell_type_from_value, false), :boolean) assert_equal(@c.send(:cell_type_from_value, 1.0/10**6), :float) + assert_equal(:iso_8601, @c.send(:cell_type_from_value, '2008-08-30T01:45:36.123+09:00')) end def test_cast_value @@ -105,6 +106,8 @@ class TestCell < Test::Unit::TestCase @c.type = :boolean assert_equal(@c.send(:cast_value, true), 1) assert_equal(@c.send(:cast_value, false), 0) + @c.type = :iso_8601 + assert_equal("2012-10-10T12:24", @c.send(:cast_value, "2012-10-10T12:24")) end def test_color @@ -299,8 +302,9 @@ class TestCell < Test::Unit::TestCase end def test_to_xml # TODO This could use some much more stringent testing related to the xml content generated! - @ws.add_row [Time.now, Date.today, true, 1, 1.0, "text", "=sum(A1:A2)"] + @ws.add_row [Time.now, Date.today, true, 1, 1.0, "text", "=sum(A1:A2)", "2013-01-13T13:31:25.123"] @ws.rows.last.cells[5].u = true + schema = Nokogiri::XML::Schema(File.open(Axlsx::SML_XSD)) doc = Nokogiri::XML(@ws.to_xml_string) errors = [] |
