summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_cell.rb
diff options
context:
space:
mode:
authorrandym <[email protected]>2018-02-08 00:14:12 +0900
committerrandym <[email protected]>2018-02-08 00:14:12 +0900
commit747ff93269c518db21c9869b61b1d1470395b502 (patch)
tree16c8d9c416a02fc7ca8bd91e058ea61c72dfc7ce /test/workbook/worksheet/tc_cell.rb
parent3f34514ecf53fb4a3401b5336833bbeb439efe2a (diff)
downloadcaxlsx-747ff93269c518db21c9869b61b1d1470395b502.tar.gz
caxlsx-747ff93269c518db21c9869b61b1d1470395b502.zip
chore(coverage) increase coverage and cleanup
Diffstat (limited to 'test/workbook/worksheet/tc_cell.rb')
-rw-r--r--test/workbook/worksheet/tc_cell.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb
index f61a254f..11b54f44 100644
--- a/test/workbook/worksheet/tc_cell.rb
+++ b/test/workbook/worksheet/tc_cell.rb
@@ -4,6 +4,7 @@ class TestCell < Test::Unit::TestCase
def setup
p = Axlsx::Package.new
+ p.use_shared_strings = true
@ws = p.workbook.add_worksheet :name=>"hmmm"
p.workbook.styles.add_style :sz=>20
@row = @ws.add_row
@@ -56,6 +57,19 @@ class TestCell < Test::Unit::TestCase
assert_equal('foo', @ws.workbook.defined_names.last.name)
end
+ def test_autowidth
+ style = @c.row.worksheet.workbook.styles.add_style({:alignment => {:horizontal => :center, :vertical => :center, :wrap_text => true}} )
+ @c.style = style
+ assert_equal(@c.autowidth, 5.5)
+ end
+
+ def test_time
+ @c.type = :time
+ now = DateTime.now
+ @c.value = now
+ assert_equal(@c.value, now.to_time)
+ end
+
def test_style
assert_raise(ArgumentError, "must reject invalid style indexes") { @[email protected] }
assert_nothing_raised("must allow valid style index changes") {@c.style=1}