Sha256: 80b5affa44bf1cdfa2e7cd9a9b78fe867d1445b6e81bed6bb20404999cdc243f

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

#! /usr/bin/ruby

$: << File.dirname(__FILE__) + '/../lib'

require 'test/unit'
require 'ole/storage'
require 'ole/property_set'

class TestTypes < Test::Unit::TestCase
	include Ole::Types

	def setup
		@io = open File.dirname(__FILE__) + '/test_SummaryInformation', 'rb'
	end

	def teardown
		@io.close
	end

	def test_property_set
		propset = PropertySet.new @io
		assert_equal :mac, propset.os
		assert_equal 1, propset.sections.length
		section = propset.sections.first
		assert_equal 14, section.length
		assert_equal 'f29f85e0-4ff9-1068-ab91-08002b27b3d9', section.guid.format
		assert_equal PropertySet::FMTID_SummaryInformation, section.guid
		assert_equal 'Charles Lowe', section.properties.assoc(4).last
		# new named support
		assert_equal 'Charles Lowe', section.doc_author
	end
	
	def test_ole_storage_integration
		Ole::Storage.open File.dirname(__FILE__) + '/test.doc', 'rb' do |ole|
			assert_equal 'Charles Lowe', ole.summary_info.doc_author
			assert_equal 'Title', ole.summary_info.doc_title
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-ole-1.2.5 test/test_property_set.rb
ruby-ole-1.2.6 test/test_property_set.rb
ruby-ole-1.2.4 test/test_property_set.rb