Sha256: 7ee594473632d31ae0bf6af5268aee434c90e4bf394ed6785a73f9340d72b379

Contents?: true

Size: 1.84 KB

Versions: 19

Compression:

Stored size: 1.84 KB

Contents

# -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/package/content_types'

class TestContentTypes < Minitest::Test
  def test_assemble_xml_file
    @obj = Writexlsx::Package::ContentTypes.new(nil)
    @obj.add_worksheet_name('sheet1')
    @obj.add_default('jpeg', 'image/jpeg')
    @obj.add_shared_strings
    @obj.add_calc_chain
    @obj.assemble_xml_file
    result = got_to_array(@obj.xml_str)
    expected = expected_to_array(<<EOS
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">

  <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
  <Default Extension="xml" ContentType="application/xml"/>
  <Default Extension="jpeg" ContentType="image/jpeg"/>

  <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
  <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
  <Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
  <Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
  <Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>
  <Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
  <Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>
  <Override PartName="/xl/calcChain.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml"/>
</Types>
EOS
    )
    assert_equal(expected, result)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
write_xlsx-1.09.4 test/package/content_types/test_content_types.rb
write_xlsx-1.09.3 test/package/content_types/test_content_types.rb
write_xlsx-1.09.2 test/package/content_types/test_content_types.rb
write_xlsx-1.09.1 test/package/content_types/test_content_types.rb
write_xlsx-1.09.0 test/package/content_types/test_content_types.rb
write_xlsx-1.08.2 test/package/content_types/test_content_types.rb
write_xlsx-1.08.1 test/package/content_types/test_content_types.rb
write_xlsx-1.08.0 test/package/content_types/test_content_types.rb
write_xlsx-1.07.0 test/package/content_types/test_content_types.rb
write_xlsx-1.04.0 test/package/content_types/test_content_types.rb
write_xlsx-1.02.0 test/package/content_types/test_content_types.rb
write_xlsx-1.01.0 test/package/content_types/test_content_types.rb
write_xlsx-1.00.0 test/package/content_types/test_content_types.rb
write_xlsx-0.99.0 test/package/content_types/test_content_types.rb
write_xlsx-0.97.0 test/package/content_types/test_content_types.rb
write_xlsx-0.90.0 test/package/content_types/test_content_types.rb
write_xlsx-0.89.0 test/package/content_types/test_content_types.rb
write_xlsx-0.88.0 test/package/content_types/test_content_types.rb
write_xlsx-0.87.0 test/package/content_types/test_content_types.rb