         }
     }
     
+    func testOptionalTypes() {
+        let string: String? = "Hello"
+        let int: Int? = 4
+        let float: Float? = 10.2
+        
+        Storage.pack(string, key: "ourOptionalTestString")
+        Storage.pack(int, key: "ourOptionalTestInt")
+        Storage.pack(float, key: "ourOptionalTestFloat")
+        
+        if let unpackedString: String? = Storage.unpack("ourOptionalTestString") {
+            XCTAssert(unpackedString == "Hello", "optional string was incorrect")
+        } else {
+            XCTFail("no optional string could be unpacked")
+        }
+        if let unpackedInt: Int? = Storage.unpack("ourOptionalTestInt") {
+            XCTAssert(unpackedInt == 4, "optional int was incorrect")
+        } else {
+            XCTFail("no optional int could be unpacked")
+        }
+        if let unpackedFloat: Float? = Storage.unpack("ourOptionalTestFloat") {
+            XCTAssert(unpackedFloat == 10.2, "optional float was incorrect")
+        } else {
+            XCTFail("no optional float could be unpacked")
+        }
+    }
+    
     func testDefaultArray() {
-        let defaults = [0,1,2,3,4]
-        
-        Storage.pack(defaults, key: "defaults_array")
-        
-        if let unpackedDefaultsArray: [Int] = Storage.unpack("defaults_array") {
-            let first = unpackedDefaultsArray[0]
-            let second = unpackedDefaultsArray[2]
-            let third = unpackedDefaultsArray[4]
-            
-            XCTAssert(first == 0, "default array first was incorrect")
-            XCTAssert(second == 2, "default array second was incorrect")
-            XCTAssert(third == 4, "default array third was incorrect")
-        } else {
-            XCTFail("no default array could be unpacked")
+        let defaultStrings = ["Default","Types","Strings"]
+        let defaultInts = [0,1,2,3,4]
+        let defaultFloats: [Float] = [10.2,31.5,28.3]
+        
+        Storage.pack(defaultStrings, key: "default_strings_array")
+        Storage.pack(defaultInts, key: "default_ints_array")
+        Storage.pack(defaultFloats, key: "default_floats_array")
+        
+        if let unpackedDefaultStringsArray: [String] = Storage.unpack("default_strings_array") {
+            
+            if unpackedDefaultStringsArray.count == 3 {
+                XCTAssert(unpackedDefaultStringsArray[0] == "Default", "string array first was incorrect")
+                XCTAssert(unpackedDefaultStringsArray[1] == "Types", "string array second was incorrect")
+                XCTAssert(unpackedDefaultStringsArray[2] == "Strings", "string array third was incorrect")
+            } else {
+                XCTFail("string array was incorrect")
+            }
+        } else {
+            XCTFail("no string array could be unpacked")
+        }
+
+        if let unpackedDefaultIntsArray: [Int] = Storage.unpack("default_ints_array") {
+            
+            if unpackedDefaultIntsArray.count == 5 {
+                XCTAssert(unpackedDefaultIntsArray[0] == 0, "int array first was incorrect")
+                XCTAssert(unpackedDefaultIntsArray[2] == 2, "int array second was incorrect")
+                XCTAssert(unpackedDefaultIntsArray[4] == 4, "int array third was incorrect")
+                
+            } else {
+                XCTFail("int array was incorrect")
+            }
+        } else {
+            XCTFail("no int array could be unpacked")
+        }
+        
+        if let unpackedDefaultFloatsArray: [Float] = Storage.unpack("default_floats_array") {
+            
+            if unpackedDefaultFloatsArray.count == 3 {
+                XCTAssert(unpackedDefaultFloatsArray[0] == 10.2, "float array first was incorrect")
+                XCTAssert(unpackedDefaultFloatsArray[1] == 31.5, "float array second was incorrect")
+                XCTAssert(unpackedDefaultFloatsArray[2] == 28.3, "float array third was incorrect")
+            } else {
+                XCTFail("float array was incorrect")
+            }
+        } else {
+            XCTFail("no float array could be unpacked")
         }
     }
     

import XCTest
@testable import Storage

class StorageTests: XCTestCase {
    struct Basic: Storable {
        let name: String

    override func setUp() {
        super.setUp()
        
        dispatch_once(&token) {
            let testFolder = JSONWarehouse(key: "basic").cacheFileURL().URLByDeletingLastPathComponent!
            print("testing in",testFolder)
            
            // remove old files before our test
            let urls = try? NSFileManager.defaultManager().contentsOfDirectoryAtURL(testFolder, includingPropertiesForKeys: nil, options: [.SkipsSubdirectoryDescendants, .SkipsHiddenFiles])
            if let urls = urls {
                for url in urls {
                    let _ = try? NSFileManager.defaultManager().removeItemAtURL(url)
                }
            }
        }
    }
    
    override func tearDown() {
        super.tearDown()
    }
    
