Sha256: f01870ae4da1a79512ce629a4687a65b15679f892d392f3ef8ac39b13aa2118b
Contents?: true
Size: 1.01 KB
Versions: 3
Compression:
Stored size: 1.01 KB
Contents
require 'tc_helper.rb' class TestCore < Test::Unit::TestCase def setup @core = Axlsx::Core.new # could still see some false positives if the second changes between the next two calls @time = Time.now.strftime('%Y-%m-%dT%H:%M:%S') @doc = Nokogiri::XML(@core.to_xml_string) end def test_valid_document schema = Nokogiri::XML::Schema(File.open(Axlsx::CORE_XSD)) errors = [] schema.validate(@doc).each do |error| puts error.message errors << error end assert_equal(errors.size, 0, "core.xml Invalid" + errors.map{ |e| e.message }.to_s) end def test_populates_created assert_equal(@doc.xpath('//dcterms:created').text, @time, "dcterms:created incorrect") end def test_populates_default_name assert_equal(@doc.xpath('//dc:creator').text, "axlsx", "Default name not populated") end def test_creator_as_option c = Axlsx::Core.new :creator => "some guy" doc = Nokogiri::XML(c.to_xml_string) assert(doc.xpath('//dc:creator').text == "some guy") end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
axlsx-1.1.7 | test/doc_props/tc_core.rb |
axlsx-1.1.6 | test/doc_props/tc_core.rb |
axlsx-1.1.5 | test/doc_props/tc_core.rb |