1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Merge pull request #819 from NodeRedis/815-tweaks

minor tweaks to how we spawn tests in #815
This commit is contained in:
Benjamin E. Coe
2015-09-11 21:40:48 -07:00
14 changed files with 180 additions and 98 deletions

View File

@@ -20,7 +20,7 @@ describe("The 'hmset' method", function () {
});
it('handles redis-style syntax', function (done) {
client.HMSET(hash, "0123456789", "abcdefghij", "some manner of key", "a type of value", helper.isString('OK'));
client.HMSET(hash, "0123456789", "abcdefghij", "some manner of key", "a type of value", "otherTypes", 555, helper.isString('OK'));
client.HGETALL(hash, function (err, obj) {
assert.equal(obj['0123456789'], 'abcdefghij');
assert.equal(obj['some manner of key'], 'a type of value');
@@ -29,7 +29,7 @@ describe("The 'hmset' method", function () {
});
it('handles object-style syntax', function (done) {
client.HMSET(hash, {"0123456789": "abcdefghij", "some manner of key": "a type of value"}, helper.isString('OK'));
client.HMSET(hash, {"0123456789": "abcdefghij", "some manner of key": "a type of value", "otherTypes": 555}, helper.isString('OK'));
client.HGETALL(hash, function (err, obj) {
assert.equal(obj['0123456789'], 'abcdefghij');
assert.equal(obj['some manner of key'], 'a type of value');
@@ -37,6 +37,15 @@ describe("The 'hmset' method", function () {
})
});
it('handles object-style syntax and the key being a number', function (done) {
client.HMSET(231232, {"0123456789": "abcdefghij", "some manner of key": "a type of value", "otherTypes": 555}, helper.isString('OK'));
client.HGETALL(231232, function (err, obj) {
assert.equal(obj['0123456789'], 'abcdefghij');
assert.equal(obj['some manner of key'], 'a type of value');
return done(err);
});
});
it('allows a numeric key', function (done) {
client.HMSET(hash, 99, 'banana', helper.isString('OK'));
client.HGETALL(hash, function (err, obj) {