diff --git a/lib/plugin.js b/lib/plugin.js index 5394225..335a789 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -2,7 +2,7 @@ var plugin = function(){}; plugin.prototype.on = function(event, handler){ if(event == "not-found" || event == "404"){ - this.not_found = handler; + this.notFound = handler; } else if(event == "setup"){ this.setup = this.setup || []; this.setup.push(handler); @@ -43,5 +43,4 @@ plugin.prototype.PATCH = function(route, handler){ this.addRoute("PATCH", route, handler); }; - module.exports = plugin; diff --git a/test/plugin.js b/test/plugin.js index 9ec36bd..a74c984 100644 --- a/test/plugin.js +++ b/test/plugin.js @@ -105,8 +105,8 @@ suite("Plugin.on", function(){ var handler = function(request, server, done){}; plugin.on("not-found", handler); - assert.ok(plugin.not_found); - assert.equal(plugin.not_found, handler); + assert.ok(plugin.notFound); + assert.equal(plugin.notFound, handler); }); test("calling on not-found twice should overwrite not-found handler", function(){ @@ -115,8 +115,8 @@ suite("Plugin.on", function(){ plugin.on("not-found", false); plugin.on("not-found", handler); - assert.ok(plugin.not_found); - assert.equal(plugin.not_found, handler); + assert.ok(plugin.notFound); + assert.equal(plugin.notFound, handler); }); test("on 404 should set not-found handler", function(){ @@ -124,8 +124,8 @@ suite("Plugin.on", function(){ var handler = function(request, server, done){}; plugin.on("404", handler); - assert.ok(plugin.not_found); - assert.equal(plugin.not_found, handler); + assert.ok(plugin.notFound); + assert.equal(plugin.notFound, handler); }); test("on with unknown event should raise Error", function(){