Skip to content

Commit

Permalink
test stringifying commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaefer committed May 18, 2011
1 parent 4a77782 commit 6bc9571
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Command.prototype.bootstrap = function(plugin, callback) {

Command.prototype.initialize = function(plugin, callback) {};

Command.prototype.toString = function() {
return '[Command ' + this.constructor.title + ']';
};

Command.augment = Backbone.Controller.augment;
Command.extend = Backbone.Controller.extend;

Expand Down
3 changes: 3 additions & 0 deletions test/stringify.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ exports['stringify'] = function() {
assert.equal(fixture.servers.Middleware + '', '<Server Middleware>');
assert.equal(new fixture.servers.Middleware + '', '[Server Middleware]');

assert.equal(fixture.commands.foo + '', '<Command foo>');
assert.equal(new fixture.commands.foo + '', '[Command foo]');

assert.equal(fixture.views.App + '', '<View App>');
assert.equal(fixture.views.Error + '', '<View Error>');
assert.equal(new fixture.views.Error({ error: 'test' }) + '', '[View Error]');
Expand Down

0 comments on commit 6bc9571

Please sign in to comment.