0
class TestPlist < Test::Unit::TestCase
0
- plist = PropertyList.load("{foo = bar; }")
0
- assert_equal( { "foo" => "bar" }, plist )
0
+ def test_deprecation_warning
0
+ savederr = STDERR.clone
0
+ plist = PropertyList.load("{foo = bar; }")
0
+ plist, format = PropertyList.load("{foo = bar; }", true)
0
+ STDERR.reopen(savederr)
0
+ assert_equal( "Warning: PropertyList is deprecated. Use OSX::PropertyList instead.\n", rd.read)
0
+ plist = OSX::PropertyList.load("{foo = bar; }")
0
+ assert_equal( { "foo" => "bar" }, plist )
0
- plist, format = PropertyList.load("{foo = bar; }", true)
0
- assert_equal( { "foo" => "bar" }, plist )
0
- assert_equal( :openstep, format )
0
- # make sure sources < 6 characters work
0
- plist = PropertyList.load("foo")
0
- assert_equal( "foo", plist )
0
- # make sure it works with format too
0
- plist, format = PropertyList.load("foo", true)
0
- assert_equal( "foo", plist )
0
- assert_equal( :openstep, format )
0
- assert_raise(PropertyListError) { PropertyList.load("") }
0
+ plist, format = OSX::PropertyList.load("{foo = bar; }", true)
0
+ assert_equal( { "foo" => "bar" }, plist )
0
+ assert_equal( :openstep, format )
0
+ # make sure sources < 6 characters work
0
+ plist = OSX::PropertyList.load("foo")
0
+ assert_equal( "foo", plist )
0
+ # make sure it works with format too
0
+ plist, format = OSX::PropertyList.load("foo", true)
0
+ assert_equal( "foo", plist )
0
+ assert_equal( :openstep, format )
0
+ assert_raise(OSX::PropertyListError) { OSX::PropertyList.load("") }
0
- time = Time.gm(2005, 4, 28, 6, 32, 56)
0
- random = "\x23\x45\x67\x89"
0
- "string!" => "indeedy",
0
+ time = Time.gm(2005, 4, 28, 6, 32, 56)
0
+ random = "\x23\x45\x67\x89"
0
+ "string!" => "indeedy",
0
- plist, format = PropertyList.load(DATA, true)
0
+ plist, format = OSX::PropertyList.load(DATA, true)
0
- assert_equal(hash, plist)
0
- assert_equal(true, plist['foo']['random'].blob?)
0
- assert_equal(false, plist['string!'].blob?)
0
- assert_equal(:xml1, format)
0
+ assert_equal(hash, plist)
0
+ assert_equal(true, plist['foo']['random'].blob?)
0
+ assert_equal(false, plist['string!'].blob?)
0
+ assert_equal(:xml1, format)
0
- str = StringIO.new("", "w")
0
- PropertyList.dump(str, hash)
0
- hash2 = PropertyList.load(str.string)
0
- assert_equal(hash, hash2)
0
+ str = StringIO.new("", "w")
0
+ OSX::PropertyList.dump(str, hash)
0
+ hash2 = OSX::PropertyList.load(str.string)
0
+ assert_equal(hash, hash2)
0
- assert_raise(PropertyListError) { "foo".to_plist(:openstep) }
0
- assert_equal("foo", PropertyList.load("foo".to_plist))
0
- assert_equal(hash, PropertyList.load(hash.to_plist))
0
+ assert_raise(OSX::PropertyListError) { "foo".to_plist(:openstep) }
0
+ assert_equal("foo", OSX::PropertyList.load("foo".to_plist))
0
+ assert_equal(hash, OSX::PropertyList.load(hash.to_plist))
0
<?xml version="1.0" encoding="UTF-8"?>
0
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/
PropertyList-1.0.dtd">
0
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/
OSX::PropertyList-1.0.dtd">
0
- <string>indeedy</string>
0
- <real>3.14159265</real>
0
- <date>2005-04-28T06:32:56Z</date>
0
+ <string>indeedy</string>
0
+ <real>3.14159265</real>
0
+ <date>2005-04-28T06:32:56Z</date>
Comments
No one has commented yet.