Skip to content

Commit

Permalink
format file
Browse files Browse the repository at this point in the history
  • Loading branch information
dbashford committed Jan 13, 2017
1 parent 9d0aacc commit 43be56e
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions test/invalid_calls_test.js
@@ -1,87 +1,87 @@
var test = function(done) {
return function(error, text) {
expect(text).to.be.null;
expect(error).to.be.an('object');
expect(error.message).to.be.an('string');
expect(error.message).to.eql("Incorrect parameters passed to textract.");
/* global fromUrl */

var test = function( done ) {
return function( error, text ) {
expect( text ).to.be.null;
expect( error ).to.be.an( 'object' );
expect( error.message ).to.be.an( 'string' );
expect( error.message ).to.eql( 'Incorrect parameters passed to textract.' );
done();
}
}
};
};

var pathTests = function(testFunction) {
var pathTests = function( testFunction ) {

var funct;

beforeEach(function() {
beforeEach( function() {
funct = testFunction();
});

it('should return an error 1', function(done) {
funct(test(done));
it( 'should return an error 1', function( done ) {
funct( test( done ) );
});

it('should return an error 2', function(done) {
funct(false, test(done));
it( 'should return an error 2', function( done ) {
funct( false, test( done ) );
});

it('should return an error 3', function(done) {
funct(test(done), false);
it( 'should return an error 3', function( done ) {
funct( test( done ), false );
});

it('should return an error 4', function(done) {
funct("foo", test(done), false);
it( 'should return an error 4', function( done ) {
funct( 'foo', test( done ), false );
});

it('should return an error 5', function(done) {
funct("foo", {}, false, test(done));
it( 'should return an error 5', function( done ) {
funct( 'foo', {}, false, test( done ) );
});
};

var bufferTests = function(testFunction) {
var bufferTests = function( testFunction ) {

var funct;

beforeEach(function() {
beforeEach( function() {
funct = testFunction();
});

it('should return an error 1', function(done) {
funct(test(done));
it( 'should return an error 1', function( done ) {
funct( test( done ) );
});

it('should return an error 2', function(done) {
funct(false, test(done));
it( 'should return an error 2', function( done ) {
funct( false, test( done ) );
});

it('should return an error 3', function(done) {
funct(test(done), false);
it( 'should return an error 3', function( done ) {
funct( test( done ), false );
});

it('should return an error 4', function(done) {
funct("foo", test(done), false);
it( 'should return an error 4', function( done ) {
funct( 'foo', test( done ), false );
});

it('should return an error 5', function(done) {
funct("foo", {}, false, test(done));
it( 'should return an error 5', function( done ) {
funct( 'foo', {}, false, test( done ) );
});
};

describe('when passed incorrect parameters', function() {

describe("fromFileWithPath", function() {
pathTests(function(){ return global.fromFileWithPath }, false);
describe( 'when passed incorrect parameters', function() {
describe( 'fromFileWithPath', function() {
pathTests( function() { return global.fromFileWithPath; }, false );
});

describe("fromFileWithMimeAndPath", function() {
pathTests(function(){ return global.fromFileWithMimeAndPath }, false);
describe( 'fromFileWithMimeAndPath', function() {
pathTests( function() { return global.fromFileWithMimeAndPath; }, false );
});

describe("fromBufferWithName", function() {
bufferTests(function(){ return global.fromBufferWithName }, false);
describe( 'fromBufferWithName', function() {
bufferTests( function() { return global.fromBufferWithName; }, false );
});

describe("fromBufferWithMime", function() {
bufferTests(function(){ return global.fromBufferWithMime }, false);
describe( 'fromBufferWithMime', function() {
bufferTests( function() { return global.fromBufferWithMime; }, false );
});

});
});

0 comments on commit 43be56e

Please sign in to comment.