Sha256: ba9fdf096bd620fe4050845018f06a3b7a45481ab3212c98092531e187770786

Contents?: true

Size: 1.54 KB

Versions: 19

Compression:

Stored size: 1.54 KB

Contents

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

class TestRelationships < Minitest::Test
  def test_assemble_xml_file
    @obj = Writexlsx::Package::Relationships.new
    @obj.add_document_relationship('/worksheet',     'worksheets/sheet1.xml')
    @obj.add_document_relationship('/theme',         'theme/theme1.xml')
    @obj.add_document_relationship('/styles',        'styles.xml')
    @obj.add_document_relationship('/sharedStrings', 'sharedStrings.xml')
    @obj.add_document_relationship('/calcChain',     'calcChain.xml')
    @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"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/>
  <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>
  <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
  <Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>
  <Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain" Target="calcChain.xml"/>
</Relationships>
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/relationships/test_relationships.rb
write_xlsx-1.09.3 test/package/relationships/test_relationships.rb
write_xlsx-1.09.2 test/package/relationships/test_relationships.rb
write_xlsx-1.09.1 test/package/relationships/test_relationships.rb
write_xlsx-1.09.0 test/package/relationships/test_relationships.rb
write_xlsx-1.08.2 test/package/relationships/test_relationships.rb
write_xlsx-1.08.1 test/package/relationships/test_relationships.rb
write_xlsx-1.08.0 test/package/relationships/test_relationships.rb
write_xlsx-1.07.0 test/package/relationships/test_relationships.rb
write_xlsx-1.04.0 test/package/relationships/test_relationships.rb
write_xlsx-1.02.0 test/package/relationships/test_relationships.rb
write_xlsx-1.01.0 test/package/relationships/test_relationships.rb
write_xlsx-1.00.0 test/package/relationships/test_relationships.rb
write_xlsx-0.99.0 test/package/relationships/test_relationships.rb
write_xlsx-0.97.0 test/package/relationships/test_relationships.rb
write_xlsx-0.90.0 test/package/relationships/test_relationships.rb
write_xlsx-0.89.0 test/package/relationships/test_relationships.rb
write_xlsx-0.88.0 test/package/relationships/test_relationships.rb
write_xlsx-0.87.0 test/package/relationships/test_relationships.rb