Browse Source

minor test refactoring

hotfix/0.7.1
Bryan Donovan 12 years ago
parent
commit
b082a4cf2b
  1. 22
      test/caching.unit.js

22
test/caching.unit.js

@ -18,9 +18,10 @@ describe("caching", function () {
var value; var value;
describe("get() and set()", function () { describe("get() and set()", function () {
context("using redis store", function () { ['redis', 'memory'].forEach(function (store) {
context("using " + store + " store", function () {
beforeEach(function () { beforeEach(function () {
cache = caching({store: 'redis'}); cache = caching({store: store});
key = support.random.string(20); key = support.random.string(20);
value = support.random.string(); value = support.random.string();
}); });
@ -35,23 +36,6 @@ describe("caching", function () {
}); });
}); });
}); });
context("using memory store", function () {
beforeEach(function () {
cache = caching({store: 'memory'});
key = support.random.string(20);
value = support.random.string();
});
it("lets us set and get data in cache", function (done) {
cache.set(key, value, function (err) {
check_err(err);
cache.get(key, function (err, result) {
assert.equal(result, value);
done();
});
});
});
}); });
}); });

Loading…
Cancel
Save