Skip to content

Commit

Permalink
Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpenev-s committed Jul 7, 2017
1 parent 808162a commit 8b3a487
Showing 1 changed file with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions test/lib.Writer.js
Expand Up @@ -352,39 +352,11 @@ describe('Lib', function () {
});
});

it('should raise wrong input type error for TINYINT', function () {
var writer = new Writer([TypeCode.TINYINT]);
Writer.prototype.setValues.bind(writer, 'w').should.throw();
});

it('should raise wrong input type error for SMALLINT', function () {
var writer = new Writer([TypeCode.SMALLINT]);
Writer.prototype.setValues.bind(writer, 'wrong').should.throw();
});

it('should raise wrong input type error for INT', function () {
var writer = new Writer([TypeCode.INT]);
Writer.prototype.setValues.bind(writer, 'wrong').should.throw();
});

it('should raise wrong input type error for BIGINT', function () {
var writer = new Writer([TypeCode.BIGINT]);
Writer.prototype.setValues.bind(writer, 'wrong').should.throw();
});

it('should raise wrong input type error for REAL', function () {
var writer = new Writer([TypeCode.REAL]);
Writer.prototype.setValues.bind(writer, 'wrong').should.throw();
});

it('should raise wrong input type error for DOUBLE', function () {
var writer = new Writer([TypeCode.DOUBLE]);
Writer.prototype.setValues.bind(writer, 'wrong').should.throw();
});

it('should raise wrong input type error for BINARY', function () {
var writer = new Writer([TypeCode.BINARY]);
Writer.prototype.setValues.bind(writer, 'wrong').should.throw();
['TINYINT', 'SMALLINT', 'INT', 'BIGINT', 'REAL', 'DOUBLE', 'BINARY'].forEach(function (type) {
it('should raise wrong input type error for ' + type, function () {
var writer = new Writer([TypeCode[type]]);
Writer.prototype.setValues.bind(writer, 'wrong').should.throw();
});
});

it('should raise wrong input type error for LOB', function () {
Expand Down

0 comments on commit 8b3a487

Please sign in to comment.