summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Bleything <ben@bleything.net>2006-08-19 17:01:29 +0000
committerBen Bleything <ben@bleything.net>2006-08-19 17:01:29 +0000
commit79ffa810071ccfed953f91effcc067cb559806ad (patch)
tree9ff3673b9776ee9de5f7175b7641b25681f3c14a
parentebe5803b3270135104981381ddaed6e0b731916f (diff)
downloadplist-79ffa810071ccfed953f91effcc067cb559806ad.tar.gz
rearrange test directory for clarity
-rw-r--r--test/assets/AlbumData.xml (renamed from test/AlbumData.xml)0
-rw-r--r--test/assets/Cookies.plist (renamed from test/Cookies.plist)0
-rw-r--r--test/assets/example_data.jpg (renamed from test/example_data.jpg)bin9503 -> 9503 bytes
-rw-r--r--test/assets/example_data.plist (renamed from test/example_data.plist)0
-rw-r--r--test/test_basic_types.rb14
-rw-r--r--test/test_narf_plist.rb23
6 files changed, 21 insertions, 16 deletions
diff --git a/test/AlbumData.xml b/test/assets/AlbumData.xml
index 7c680e8..7c680e8 100644
--- a/test/AlbumData.xml
+++ b/test/assets/AlbumData.xml
diff --git a/test/Cookies.plist b/test/assets/Cookies.plist
index f4c68fd..f4c68fd 100644
--- a/test/Cookies.plist
+++ b/test/assets/Cookies.plist
diff --git a/test/example_data.jpg b/test/assets/example_data.jpg
index f7a50f8..f7a50f8 100644
--- a/test/example_data.jpg
+++ b/test/assets/example_data.jpg
Binary files differ
diff --git a/test/example_data.plist b/test/assets/example_data.plist
index 736f54e..736f54e 100644
--- a/test/example_data.plist
+++ b/test/assets/example_data.plist
diff --git a/test/test_basic_types.rb b/test/test_basic_types.rb
index 669d920..3483373 100644
--- a/test/test_basic_types.rb
+++ b/test/test_basic_types.rb
@@ -1,11 +1,9 @@
-#!/usr/bin/env ruby
-
-######################################
-# Copyright 2006, Ben Bleything. #
-# <ben@bleything.net> #
-# #
-# Distributed under the MIT license. #
-######################################
+##############################################################
+# Copyright 2006, Ben Bleything <ben@bleything.net> and #
+# Patrick May <patrick@hexane.org> #
+# #
+# Distributed under the MIT license. #
+##############################################################
require 'test/unit'
require 'plist'
diff --git a/test/test_narf_plist.rb b/test/test_narf_plist.rb
index e7ae9d8..56c80d9 100644
--- a/test/test_narf_plist.rb
+++ b/test/test_narf_plist.rb
@@ -1,3 +1,10 @@
+##############################################################
+# Copyright 2006, Ben Bleything <ben@bleything.net> and #
+# Patrick May <patrick@hexane.org> #
+# #
+# Distributed under the MIT license. #
+##############################################################
+
require 'test/unit'
require 'pp'
@@ -5,7 +12,7 @@ require 'plist'
class TestPlist < Test::Unit::TestCase
def test_Plist_parse_xml
- result = Plist::parse_xml("test/AlbumData.xml")
+ result = Plist::parse_xml("test/assets/AlbumData.xml")
# dict
assert_kind_of( Hash, result )
@@ -54,7 +61,7 @@ class TestPlist < Test::Unit::TestCase
# date fields are credited to
def test_date_fields
- result = Plist::parse_xml("test/Cookies.plist")
+ result = Plist::parse_xml("test/assets/Cookies.plist")
assert_kind_of( DateTime, result.first['Expires'] )
assert_equal( "2007-10-25T12:36:35Z", result.first['Expires'].to_s )
end
@@ -73,7 +80,7 @@ class TestPlist < Test::Unit::TestCase
assert_equal( Plist::_xml("<dict>\n\t<key>False</key>\n\t<false/>\n\t<key>True</key>\n\t<true/>\n</dict>"),
{ 'True' => true, 'False' => false }.to_plist )
- source = File.open("test/AlbumData.xml") { |f| f.read }
+ source = File.open("test/assets/AlbumData.xml") { |f| f.read }
result = Plist::parse_xml(source)
@@ -90,13 +97,13 @@ class TestPlist < Test::Unit::TestCase
# who discovered the plist with the data tag
# supplied the test data, and provided the parsing code.
def test_data
- data = Plist::parse_xml("test/example_data.plist");
- assert_equal( File.open("test/example_data.jpg"){|f| f.read }, data['image'].read )
- assert_equal( File.open("test/example_data.plist"){|f| f.read }, data.to_plist )
+ data = Plist::parse_xml("test/assets/example_data.plist");
+ assert_equal( File.open("test/assets/example_data.jpg"){|f| f.read }, data['image'].read )
+ assert_equal( File.open("test/assets/example_data.plist"){|f| f.read }, data.to_plist )
- data['image'] = StringIO.new( File.open("test/example_data.jpg"){ |f| f.read } )
+ data['image'] = StringIO.new( File.open("test/assets/example_data.jpg"){ |f| f.read } )
File.open('temp.plist', 'w'){|f| f.write data.to_plist }
- assert_equal( File.open("test/example_data.plist"){|f| f.read }, data.to_plist )
+ assert_equal( File.open("test/assets/example_data.plist"){|f| f.read }, data.to_plist )
File.delete('temp.plist') if File.exists?('hello.plist')