Skip to content

Commit

Permalink
Switch InternalOAuthError test case to Mocha.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Aug 13, 2013
1 parent 79d2ffd commit 9d625a3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 39 deletions.
39 changes: 0 additions & 39 deletions test/errors/internaloautherror-test.js

This file was deleted.

30 changes: 30 additions & 0 deletions test/errors/internaloautherror.test.js
@@ -0,0 +1,30 @@
var InternalOAuthError = require('../../lib/errors/internaloautherror');


describe('InternalOAuthError', function() {

describe('constructed with a message', function() {
var err = new InternalOAuthError('oops');

it('should format correctly', function() {
expect(err.toString()).to.equal('oops');
});
});

describe('constructed with a message and error', function() {
var err = new InternalOAuthError('oops', new Error('something is wrong'));

it('should format correctly', function() {
expect(err.toString()).to.equal('oops (Error: something is wrong)');
});
});

describe('constructed with a message and object with status code and data', function() {
var err = new InternalOAuthError('oops', { statusCode: 401, data: 'invalid OAuth credentials' });

it('should format correctly', function() {
expect(err.toString()).to.equal('oops (status: 401 data: invalid OAuth credentials)');
});
});

});

0 comments on commit 9d625a3

Please sign in to comment.