Skip to content

Commit

Permalink
fix: add command tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BridgeAR committed Aug 1, 2017
1 parent 79558c5 commit ad8355a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/node_redis.spec.js
Expand Up @@ -12,7 +12,9 @@ var client;

describe('The node_redis client', function () {

describe.only("The 'add_command' method", function () {
describe("The 'add_command' method", function () {

var Redis = redis.RedisClient;

it('camel case and snakeCase version exists', function () {
assert.strictEqual(typeof redis.addCommand, 'function');
Expand All @@ -21,12 +23,12 @@ describe('The node_redis client', function () {

it('converts special characters in functions names to lowercase', function () {
var command = 'really-new.command';
assert.strictEqual(redis.prototype[command], undefined);
assert.strictEqual(Redis.prototype[command], undefined);
redis.addCommand(command);
assert.strictEqual(redis.prototype[command].name, 'really_new_command');
assert.strictEqual(redis.prototype[command.toUpperCase()].name, 'really_new_command');
assert.strictEqual(redis.prototype.really_new_command.name, 'really_new_command');
assert.strictEqual(redis.prototype.REALLY_NEW_COMMAND.name, 'really_new_command');
assert.strictEqual(Redis.prototype[command].name, 'really_new_command');
assert.strictEqual(Redis.prototype[command.toUpperCase()].name, 'really_new_command');
assert.strictEqual(Redis.prototype.really_new_command.name, 'really_new_command');
assert.strictEqual(Redis.prototype.REALLY_NEW_COMMAND.name, 'really_new_command');
});
});

Expand Down

0 comments on commit ad8355a

Please sign in to comment.