test.js 714 Bytes
Newer Older
Nicolas Widart's avatar
Nicolas Widart committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
'use strict';

var phpspec = require('../'),
    should  = require('should');

require('mocha');

describe('gulp-phpspec', function() {

		it('should not error if no parameters passed', function(done) {

			// Arrange
			var caughtErr;

			// Act
			try {
				phpspec();
			} catch (err) {
				caughtErr = err;
			}
			// Assert
			should.not.exist(caughtErr);
			//caughtErr.message.indexOf('required').should.be.above(-1);
			done();
		});

		it('should throw error if object passed as first parameter', function(done) {

			// arrange
			var caughtErr;

			// act
			try {
				phpspec({debug: true});
			} catch (err) {
				caughtErr = err;
			}

			// assert
			should.exist(caughtErr);

			done();

		});

});