Sha256: 07716faf43655933b63d7dccf402fa8ebb0616b67c552502d96c5fb320ec8971

Contents?: true

Size: 1.54 KB

Versions: 52

Compression:

Stored size: 1.54 KB

Contents

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

class TestRelationships < Test::Unit::TestCase
  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

52 entries across 52 versions & 1 rubygems

Version Path
write_xlsx-0.86.0 test/package/relationships/test_relationships.rb
write_xlsx-0.85.11 test/package/relationships/test_relationships.rb
write_xlsx-0.85.10 test/package/relationships/test_relationships.rb
write_xlsx-0.85.9 test/package/relationships/test_relationships.rb
write_xlsx-0.85.8 test/package/relationships/test_relationships.rb
write_xlsx-0.85.7 test/package/relationships/test_relationships.rb
write_xlsx-0.85.6 test/package/relationships/test_relationships.rb
write_xlsx-0.85.5 test/package/relationships/test_relationships.rb
write_xlsx-0.85.4 test/package/relationships/test_relationships.rb
write_xlsx-0.85.3 test/package/relationships/test_relationships.rb
write_xlsx-0.85.2 test/package/relationships/test_relationships.rb
write_xlsx-0.85.1 test/package/relationships/test_relationships.rb
write_xlsx-0.83.0 test/package/relationships/test_relationships.rb
write_xlsx-0.81.1 test/package/relationships/test_relationships.rb
write_xlsx-0.81.0 test/package/relationships/test_relationships.rb
write_xlsx-0.80.0 test/package/relationships/test_relationships.rb
write_xlsx-0.79.0 test/package/relationships/test_relationships.rb
write_xlsx-0.78.0 test/package/relationships/test_relationships.rb
write_xlsx-0.77.2 test/package/relationships/test_relationships.rb
write_xlsx-0.77.1 test/package/relationships/test_relationships.rb