Sha256: e9c75db51caa2c1eee3909d18b4da80f3d5d76ccc175e42fbc8ab56e5f5c072e

Contents?: true

Size: 1.72 KB

Versions: 15

Compression:

Stored size: 1.72 KB

Contents

# -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx'
require 'stringio'

class TestStyles01 < Test::Unit::TestCase
  def test_styles_01
    workbook = WriteXLSX.new(StringIO.new)
    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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  <fonts count="1">
    <font>
      <sz val="11"/>
      <color theme="1"/>
      <name val="Calibri"/>
      <family val="2"/>
      <scheme val="minor"/>
    </font>
  </fonts>
  <fills count="2">
    <fill>
      <patternFill patternType="none"/>
    </fill>
    <fill>
      <patternFill patternType="gray125"/>
    </fill>
  </fills>
  <borders count="1">
    <border>
      <left/>
      <right/>
      <top/>
      <bottom/>
      <diagonal/>
    </border>
  </borders>
  <cellStyleXfs count="1">
    <xf numFmtId="0" fontId="0" fillId="0" borderId="0"/>
  </cellStyleXfs>
  <cellXfs count="1">
    <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
  </cellXfs>
  <cellStyles count="1">
    <cellStyle name="Normal" xfId="0" builtinId="0"/>
  </cellStyles>
  <dxfs count="0"/>
  <tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleLight16"/>
</styleSheet>
EOS
      )
    assert_equal(expected, result)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
write_xlsx-0.64.1 test/package/styles/test_styles_01.rb
write_xlsx-0.64.0 test/package/styles/test_styles_01.rb
write_xlsx-0.62.0 test/package/styles/test_styles_01.rb
write_xlsx-0.61.0 test/package/styles/test_styles_01.rb
write_xlsx-0.60.0 test/package/styles/test_styles_01.rb
write_xlsx-0.59.0 test/package/styles/test_styles_01.rb
write_xlsx-0.58.0 test/package/styles/test_styles_01.rb
write_xlsx-0.57.0 test/package/styles/test_styles_01.rb
write_xlsx-0.56.0 test/package/styles/test_styles_01.rb
write_xlsx-0.55.0 test/package/styles/test_styles_01.rb
write_xlsx-0.54.0 test/package/styles/test_styles_01.rb
write_xlsx-0.51.0 test/package/styles/test_styles_01.rb
write_xlsx-0.0.4 test/package/styles/test_styles_01.rb
write_xlsx-0.0.3 test/package/styles/test_styles_01.rb
write_xlsx-0.0.2 test/package/styles/test_styles_01.rb