diff options
| -rw-r--r-- | test/workbook/worksheet/tc_col.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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 |
