Sha256: 41f4d08366e3925fe40e6d4f301c8ee66650ba39194c5cbf0a9a578df6b1552a

Contents?: true

Size: 1.15 KB

Versions: 17

Compression:

Stored size: 1.15 KB

Contents

#! /usr/bin/ruby

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

require 'test/unit'
require 'ole/types'

class TestPropertySet < 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.to_a.assoc(4).last
		assert_equal 'Charles Lowe', propset.doc_author
		assert_equal 'Charles Lowe', propset.to_h[:doc_author]

		# knows the difference between existent and non-existent properties
		assert_raise(NoMethodError) { propset.non_existent_key }
		assert_raise(NotImplementedError) { propset.doc_author = 'New Author'}
		assert_raise(NoMethodError) { propset.non_existent_key = 'Value'}
		
		# a valid property that has no value in this property set
		assert_equal nil, propset.security
	end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
ruby-ole-1.2.13.1 test/test_property_set.rb
ruby-ole-1.2.13 test/test_property_set.rb
ruby-ole-1.2.12.2 test/test_property_set.rb
ruby-ole-1.2.12.1 test/test_property_set.rb
ruby-ole-1.2.12 test/test_property_set.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/ruby-ole-1.2.11.8/test/test_property_set.rb
ruby-ole-1.2.11.8 test/test_property_set.rb
keeguon-ruby-ole-1.2.11.8 test/test_property_set.rb
keeguon-ruby-ole-1.2.11.7 test/test_property_set.rb
ruby-ole-1.2.11.7 test/test_property_set.rb
ruby-ole-1.2.11.6 test/test_property_set.rb
ruby-ole-1.2.11.5 test/test_property_set.rb
ruby-ole-1.2.11.4 test/test_property_set.rb
ruby-ole-1.2.11.3 test/test_property_set.rb
ruby-ole-1.2.11.2 test/test_property_set.rb
ruby-ole-1.2.11.1 test/test_property_set.rb
ruby-ole-1.2.11 test/test_property_set.rb