Skip to content
Myr

Memory cache now allows objects as values

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 46fdf10 · Browse files · 2 files+8 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+8 added−6 removed

  • tests:+7 added−4 removed
  • other:+1 added−2 removed

2 files+8 added−6 removed

modified:lib/express/plugins/cache.js+1 added-2 removed
modified:spec/spec.plugins.cache.js+7 added-4 removed
54 unmodified lines
55 end56 end57 58 describe 'given an abitrary value'59 it 'should throw an error'60 -{ store.set('foo', null) }.should.throw_error61 -{ store.set('foo', undefined) }.should.throw_error62 -{ store.set('foo', {}) }.should.throw_error59 it 'should serialize as JSON'60 store.set('user', { name: 'tj' }).should.eql { name: 'tj' }61 end62 end63 end64
2 unmodified lines
67 it 'should return cached value'68 store.set('foo', 'bar')69 store.get('foo').should.eql 'bar'70 end71 72 it 'should unserialize JSON data'73 store.set('user', { name: 'tj' })74 store.get('user').should.eql { name: 'tj' }75 end76 end77 78 describe 'given wildcards'79 it 'should return a set of caches'
31 unmodified lines