describe("Kojac.CanCache Specs", function() { beforeEach(function () { this.cache = new Kojac.CanCache({}); var factory = new Kojac.CanObjectFactory({}); this.kojac = new Kojac.Core({ cache: this.cache, remoteProvider: new Kojac.RemoteProvider({useMockFileValues: true,mockFilePath: 'mockjson/'}), objectFactory: factory, apiVersion: 1 }); }); var testValues = { astring: 'some string', anumber: 12345, aboolean: true, adate: Date.now(), aobject: {name: 'A little object'}, aarray: [1,2,3,4,5] }; it("should return the same type as was stored", function() { var cache = this.cache; _.each(['astring','anumber','aboolean','adate'],function(p) { cache.attr(p,testValues[p]); expect(cache.attr(p)).toEqual(testValues[p]); }); var p = 'aobject'; cache.attr(p,testValues[p]); var cacheValue = cache.attr(p); expect(cacheValue.attr()).toEqual(testValues.aobject); expect(cacheValue.name).toEqual(testValues.aobject.name); p = 'aarray'; cache.attr(p,testValues[p]); cacheValue = cache.attr(p); expect(cacheValue.attr()).toEqual(testValues[p]); for (var i=0;i