Fix typo in constructor

This commit is contained in:
Juan Cruz Viotti 2014-11-24 14:41:16 -04:00
parent 5549a2bd9e
commit 86548fc3d2
2 changed files with 9 additions and 1 deletions

@ -2,7 +2,7 @@ TypedError = require('typed-error')
log = require('../log/log')
exports.NotFound = class NotFound extends TypedError
contructor: (name) ->
constructor: (name) ->
@message = "Couldn't find #{name}"
exports.handle = (error, exit = true) ->

@ -47,3 +47,11 @@ describe 'Errors:', ->
it 'should not exit if the last parameter is false', ->
checkProcessExitOption false, (processExitStub) ->
expect(processExitStub).to.not.have.been.called
describe 'NotFound', ->
it 'should get a custom message', ->
message = 'Foo'
error = new errors.NotFound(message)
expect(error.message).to.not.equal(message)
expect(error.message).to.contain(message)