Sha256: c996b94749ad44de5f4839138b9ed76e975d66d2f86f2d35ec48f532eeeacb6b

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

# encoding: UTF-8
require 'tc_helper.rb'

class TestDefault < Test::Unit::TestCase

  def test_content_type_restriction
    assert_raise(ArgumentError, "raises argument error if invlalid ContentType is") { Axlsx::Default.new :ContentType=>"asdf" }
  end

  def test_to_xml_string
    type = Axlsx::Default.new :Extension=>"xml", :ContentType=>Axlsx::XML_CT
    doc = Nokogiri::XML(type.to_xml_string)
    assert_equal(doc.xpath("Default[@ContentType='#{Axlsx::XML_CT}']").size, 1)
    assert_equal(doc.xpath("Default[@Extension='xml']").size, 1)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caxlsx-3.2.0 test/content_type/tc_default.rb