...
 
Commits (4)
0.1.2
- Returning an error when the Memcached server issues a NOT_STORED response.
0.1.1
- Now using 3rd-Eden/jackpot as connection pool, this should give a more stable
connection.
......
......@@ -359,6 +359,7 @@ Client.config = {
}
, 'NOT_STORED': function notstored(tokens, dataSet, err) {
err.push('Item is not stored');
return [CONTINUE, false];
}
......
{
"name": "memcached"
, "version": "0.1.1"
, "version": "0.1.2"
, "author": "Arnout Kazemier"
, "description": "A fully featured Memcached API client, supporting both single and clustered Memcached servers through consistent hashing and failover/failure. Memcached is rewrite of nMemcached, which will be deprecated in the near future."
, "main": "index"
......
/**
* Test dependencies
*/
var assert = require('assert')
, fs = require('fs')
, common = require('./common')
, Memcached = require('../');
global.testnumbers = global.testnumbers || +(Math.random(10) * 1000000).toFixed();
/**
* Expresso test suite for all `add` related
* memcached commands
*/
describe("Memcached ADD", function() {
/**
* Make sure that adding a key which already exists returns an error.
*/
it("fail to add an already existing key", function(done) {
var memcached = new Memcached(common.servers.single)
, message = common.alphabet(256)
, testnr = ++global.testnumbers
, callbacks = 0;
memcached.set("test:" + testnr, message, 1000, function(error, ok){
++callbacks;
assert.ok(!error);
ok.should.be.true;
memcached.add("test:" + testnr, message, 1000, function(error, answer){
++callbacks;
assert.ok(error);
memcached.end(); // close connections
assert.equal(callbacks, 2);
done();
});
});
});
});