summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-12-01 14:38:13 +0900
committerRandy Morgan <[email protected]>2011-12-01 14:38:13 +0900
commit6439ce4d2ec5c97ad82a8dc10d974ca9754f2113 (patch)
tree87b3958c6cff8b7c2aed2804702a8ff8089d841f /test
parent8cf0296bbc16e8eb535e9af932eed2557d5e66d2 (diff)
downloadcaxlsx-6439ce4d2ec5c97ad82a8dc10d974ca9754f2113.tar.gz
caxlsx-6439ce4d2ec5c97ad82a8dc10d974ca9754f2113.zip
added default formatting for date types when the cell style is 0 and the data type is :time
Diffstat (limited to 'test')
-rw-r--r--test/rels/tc_relationships.rb1
-rw-r--r--test/stylesheet/tc_styles.rb12
-rw-r--r--test/workbook/worksheet/tc_cell.rb7
3 files changed, 6 insertions, 14 deletions
diff --git a/test/rels/tc_relationships.rb b/test/rels/tc_relationships.rb
index fb3795c3..c6b4860d 100644
--- a/test/rels/tc_relationships.rb
+++ b/test/rels/tc_relationships.rb
@@ -3,7 +3,6 @@ require 'axlsx.rb'
class TestRelationships < Test::Unit::TestCase
-
def test_valid_document
@rels = Axlsx::Relationships.new
schema = Nokogiri::XML::Schema(File.open(Axlsx::RELS_XSD))
diff --git a/test/stylesheet/tc_styles.rb b/test/stylesheet/tc_styles.rb
index 0c9b3fba..15020608 100644
--- a/test/stylesheet/tc_styles.rb
+++ b/test/stylesheet/tc_styles.rb
@@ -49,16 +49,4 @@ class TestStyles < Test::Unit::TestCase
end
-
- #:numFmts, :fonts, :fills, :borders, :cellStyleXfs, :cellXfs, :dxfs, :tableStyles
- def test_ensure_locking
- assert_equal(@styles.numFmts.locked_at, 2, "numFmts should be locked at 2")
- assert_equal(@styles.fonts.locked_at, 1, "fonts should be locked at 1" )
- assert_equal(@styles.fills.locked_at, 2, "fills should be locked at 2" )
- assert_equal(@styles.borders.locked_at, 2, "borders should be locked at two" )
- assert_equal(@styles.cellStyleXfs.locked_at, 1, "cellStyleXfs should be locked at two" )
- assert_equal(@styles.cellXfs.locked_at, 2, "cellXfs should be locked at 2" )
- assert_equal(@styles.dxfs.locked_at, 0, "dxfs should be locked at 0" )
- assert_equal(@styles.tableStyles.locked_at, 0, "tableStyles should be locked at 0" )
- end
end
diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb
index 6cc9a2c8..58c76bbc 100644
--- a/test/workbook/worksheet/tc_cell.rb
+++ b/test/workbook/worksheet/tc_cell.rb
@@ -18,6 +18,11 @@ class TestCell < Test::Unit::TestCase
assert_equal(@c.value, 1.0, "type option is applied and value is casted")
end
+ def test_style_date_data
+ c = Axlsx::Cell.new(@c.row, Time.now)
+ assert_equal(Axlsx::STYLE_DATE, c.style)
+ end
+
def test_index
assert_equal(@c.index, @row.cells.index(@c))
end
@@ -31,7 +36,7 @@ class TestCell < Test::Unit::TestCase
end
def test_style
- assert_raise(ArgumentError, "must reject invalid style indexes") { @c.style=3 }
+ assert_raise(ArgumentError, "must reject invalid style indexes") { @[email protected] }
assert_nothing_raised("must allow valid style index changes") {@c.style=1}
assert_equal(@c.style, 1)
end