Browse Source

Merge branch 'release/0.12.0'

feature/nested-cache-fetch-fix 0.12.0
Bryan Donovan 10 years ago
parent
commit
56df3c7880
  1. 3
      History.md
  2. 6
      lib/caching.js
  3. 2
      package.json
  4. 17
      test/caching.unit.js

3
History.md

@ -1,3 +1,6 @@
- 0.12.0 2014-10-09
Checking for existence of del() method before binding to it. Fixes #11.
- 0.11.0 2014-09-18
Prevent stalemate by executing callbacks on error. Fixes #10 - elliotttf

6
lib/caching.js

@ -1,4 +1,4 @@
/*jshint maxcomplexity:10*/
/*jshint maxcomplexity:15*/
var caching = function (args) {
args = args || {};
var self = {};
@ -78,7 +78,9 @@ var caching = function (args) {
self.set = self.store.set.bind(self.store);
self.del = self.store.del.bind(self.store);
if (typeof self.store.del === 'function') {
self.del = self.store.del.bind(self.store);
}
if (typeof self.store.setex === 'function') {
self.setex = self.store.setex.bind(self.store);

2
package.json

@ -1,6 +1,6 @@
{
"name": "cache-manager",
"version": "0.11.0",
"version": "0.12.0",
"description": "Cache module for Node.js",
"main": "index.js",
"scripts": {

17
test/caching.unit.js

@ -145,6 +145,23 @@ describe("caching", function () {
});
}, 10);
});
context("when store has no del() method", function () {
var fake_store;
beforeEach(function () {
fake_store = {
get: function () {},
set: function () {},
};
});
it("it doesn't throw an error", function () {
assert.doesNotThrow(function () {
caching({store: fake_store});
});
});
});
});
describe("setex()", function () {

Loading…
Cancel
Save