 "use strict"
 
+_ = require("underscore")
 StoreIt = require("..") # load StoreIt!
 StoreitError = StoreIt.StoreitError;
 


describe "StoreIt!", ->
    service = null

    beforeEach ->
        @storageProvider = {

                @return = service.get("testkeyINVALID", "fun hater")
                @return.should.equal("fun hater")

        describe "when calling set with a key and value", ->
            key = "testkey1"
            value = {foo: "foo1"}
            value2 = {foo: "bar1"}
            setArgs = [[key, value], [key, value2], [key, value2]]
            testSet(key, value, value2, setArgs)

        describe "when calling set with only a value (PK default of 'id')", ->
            key = "testkey1"
            value = {id: key, foo: "foo2"}
            value2 = {id: key, foo: "bar2"}
            setArgs = [[value], [value2], [value2]]
            testSet(key, value, value2, setArgs, "id")

        describe "when calling set with only a value (PK of 'dw')", ->
            key = "testkey1"
            value = {dw: key, foo: "foo2"}
            value2 = {dw: key, foo: "bar2"}
            setArgs = [[value], [value2], [value2]]
            testSet(key, value, value2, setArgs, "dw")

        describe "when calling set on a key that exists (object)", ->
            beforeEach ->
