Sha256: 5dd174902d9c924930ae68cfecebf374499bbaef5767529ea28311032f8f73fd

Contents?: true

Size: 556 Bytes

Versions: 24

Compression:

Stored size: 556 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

24 entries across 24 versions & 6 rubygems

Version Path
caxlsx-3.1.1 test/content_type/tc_default.rb
caxlsx-3.1.0 test/content_type/tc_default.rb
bonio-axlsx-2.2.3 test/content_type/tc_default.rb
caxlsx-3.0.4 test/content_type/tc_default.rb
caxlsx-3.0.3 test/content_type/tc_default.rb
caxlsx-3.0.2 test/content_type/tc_default.rb
caxlsx-2.0.2 test/content_type/tc_default.rb
caxlsx-3.0.1 test/content_type/tc_default.rb
caxlsx-3.0.0 test/content_type/tc_default.rb
axlsx-alt-3.0.1 test/content_type/tc_default.rb
axlsx-alt-3.0.0 test/content_type/tc_default.rb
axlsx-3.0.0.pre test/content_type/tc_default.rb
bonio-axlsx-2.2.2 test/content_type/tc_default.rb
bonio-axlsx-2.2.1 test/content_type/tc_default.rb
dg-axlsx-2.1.0 test/content_type/tc_default.rb
axlsx-2.1.0.pre test/content_type/tc_default.rb
l_axlsx-2.0.1 test/content_type/tc_default.rb
axlsx-2.0.1 test/content_type/tc_default.rb
axlsx-2.0.0 test/content_type/tc_default.rb
axlsx-1.3.6 test/content_type/tc_default.rb