# -*- coding: utf-8 -*- require 'helper' require 'write_xlsx/workbook' require 'write_xlsx/package/styles' require 'stringio' class TestStyles05 < Test::Unit::TestCase def test_styles_05 workbook = WriteXLSX.new(StringIO.new) format1 = workbook.add_format(:left => 1) format2 = workbook.add_format(:right => 1) format3 = workbook.add_format(:top => 1) format4 = workbook.add_format(:bottom => 1) format5 = workbook.add_format(:diag_type => 1, :diag_border => 1) format6 = workbook.add_format(:diag_type => 2, :diag_border => 1) format7 = workbook.add_format(:diag_type => 3) workbook.__send__('set_default_xf_indices') workbook.__send__('prepare_format_properties') @style = Writexlsx::Package::Styles.new @style.set_style_properties( workbook.xf_formats, workbook.palette, workbook.font_count, workbook.num_format_count, workbook.border_count, workbook.fill_count, workbook.custom_colors, workbook.dxf_formats ) @style.assemble_xml_file result = got_to_array(@style.xml_str) expected = expected_to_array(< EOS ) assert_equal(expected, result) end end