From 45dad9aa611a24b69bfe10ba8207b60378d21d58 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 21 Oct 2012 08:11:26 +0900 Subject: Fixed and added specs for best_fit and custom_width attribute serialization --- test/workbook/worksheet/tc_col.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/workbook/worksheet/tc_col.rb b/test/workbook/worksheet/tc_col.rb index 9621eb14..c0c5e64b 100644 --- a/test/workbook/worksheet/tc_col.rb +++ b/test/workbook/worksheet/tc_col.rb @@ -58,6 +58,16 @@ class TestCol < Test::Unit::TestCase assert_nothing_raised(ArgumentError, 'phonetic must be boolean(ish)') { @col.phonetic = true } end + def test_to_xml_string + @col.width = 100 + doc = Nokogiri::XML(@col.to_xml_string) + assert_equal(1, doc.xpath("//col [@bestFit='#{@col.best_fit}']").size) + assert_equal(1, doc.xpath("//col [@max=#{@col.max}]").size) + assert_equal(1, doc.xpath("//col [@min=#{@col.min}]").size) + assert_equal(1, doc.xpath("//col [@width=#{@col.width}]").size) + assert_equal(1, doc.xpath("//col [@customWidth='#{@col.custom_width}']").size) + end + def test_style assert_equal(@col.style, nil) @col.style = 1 -- cgit v1.2.3