Sha256: 8f943aaf6b9478a2b84cbe7db83a9fa6a2f1b866c86d12f507f10f383f37380e
Contents?: true
Size: 1.34 KB
Versions: 19
Compression:
Stored size: 1.34 KB
Contents
# -*- coding: utf-8 -*- require 'helper' require 'write_xlsx' require 'stringio' class TestTable07 < Minitest::Test def setup workbook = WriteXLSX.new(StringIO.new) @worksheet = workbook.add_worksheet end def test_table07 # Set the table properties. @worksheet.add_table( 'C3:F14', { :total_row => 1 } ) @worksheet.__send__(:prepare_tables, 1, {}) table = @worksheet.tables[0] table.__send__(:assemble_xml_file) result = got_to_array(table.instance_variable_get(:@writer).string) assert_equal(expected, result) end def expected expected_to_array( <<EOS <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="1" name="Table1" displayName="Table1" ref="C3:F14" totalsRowCount="1"> <autoFilter ref="C3:F13"/> <tableColumns count="4"> <tableColumn id="1" name="Column1"/> <tableColumn id="2" name="Column2"/> <tableColumn id="3" name="Column3"/> <tableColumn id="4" name="Column4"/> </tableColumns> <tableStyleInfo name="TableStyleMedium9" showFirstColumn="0" showLastColumn="0" showRowStripes="1" showColumnStripes="0"/> </table> EOS ) end end
Version data entries
19 entries across 19 versions & 1 rubygems