Sha256: a80294a9552cda9b7a97287cab31356c7b657d78bd54c94ac7e8f58d115a200f

Contents?: true

Size: 624 Bytes

Versions: 7

Compression:

Stored size: 624 Bytes

Contents

require 'test/unit'
require 'axlsx.rb'

class TestRelationships < Test::Unit::TestCase

  def test_valid_document
    @rels = Axlsx::Relationships.new
    schema = Nokogiri::XML::Schema(File.open(Axlsx::RELS_XSD))
    doc = Nokogiri::XML(@rels.to_xml)
    errors = []
    schema.validate(doc).each do |error|
      puts error.message
      errors << error
    end

    @rels << Axlsx::Relationship.new(Axlsx::WORKSHEET_R, "bar")
    doc = Nokogiri::XML(@rels.to_xml)
    errors = []
    schema.validate(doc).each do |error|
      puts error.message
      errors << error
    end

    assert(errors.size == 0)    
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
axlsx-1.0.18 test/rels/tc_relationships.rb
axlsx-1.0.17 test/rels/tc_relationships.rb
axlsx-1.0.16 test/rels/tc_relationships.rb
axlsx-1.0.15 test/rels/tc_relationships.rb
axlsx-1.0.14 test/rels/tc_relationships.rb
axlsx-1.0.12 test/rels/tc_relationships.rb
axlsx-1.0.11 test/rels/tc_relationships.rb