You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
var assert = require('assert');
|
|
|
|
var support = require('../support');
|
|
|
|
var memoryStore = require('../../lib/stores/memory');
|
|
|
|
|
|
|
|
describe("memory store", function() {
|
|
|
|
describe("instantiating", function() {
|
|
|
|
it("lets us pass in no args", function(done) {
|
|
|
|
var memoryCache = memoryStore.create();
|
|
|
|
support.testSetGetDel(memoryCache, done);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("set()", function() {
|
|
|
|
var memoryCache;
|
|
|
|
|
|
|
|
beforeEach(function() {
|
|
|
|
memoryCache = memoryStore.create({noPromises: true});
|
|
|
|
});
|
|
|
|
|
|
|
|
it("does not require a callback", function(done) {
|
|
|
|
memoryCache.set('foo', 'bar');
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
assert.equal(memoryCache.get('foo'), 'bar');
|
|
|
|
done();
|
|
|
|
}, 10);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|