Sha256: 31f3e176b0bf460c538b2bdfbba2a5f95e386697a7b188d1f2f3533da4a0b8a4

Contents?: true

Size: 676 Bytes

Versions: 10

Compression:

Stored size: 676 Bytes

Contents

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

class TestRelationships < Test::Unit::TestCase
  def setup    
    @rels = Axlsx::Relationships.new
  end
  
  def teardown    
  end  

  def test_valid_document
    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

10 entries across 10 versions & 1 rubygems

Version Path
axlsx-1.0.10a test/rels/tc_relationships.rb
axlsx-1.0.9 test/rels/tc_relationships.rb
axlsx-1.0.8 test/rels/tc_relationships.rb
axlsx-1.0.7 test/rels/tc_relationships.rb
axlsx-1.0.6 test/rels/tc_relationships.rb
axlsx-1.0.5 test/rels/tc_relationships.rb
axlsx-1.0.4 test/rels/tc_relationships.rb
axlsx-1.0.3 test/rels/tc_relationships.rb
axlsx-1.0.1 test/rels/tc_relationships.rb
axlsx-1.0.0 test/rels/tc_relationships.rb