mikeerickson
2/22/2014 - 10:53 PM

Gulp PHPSpec automated testing ....

Gulp PHPSpec automated testing ....

/* Gulpfile
 * Mike Erickson
 */

var gulp     = require('gulp'),
	  notify   = require('gulp-notify'),
	  phpspec  = require('gulp-phpspec');

gulp.task('phpspec', function() {
	var options = {debug: true};
	gulp.src('spec/**/*.php')
		.pipe(phpspec('', options))
		.on('error', notify.onError({
			title: "Testing Failed",
			message: "Error(s) occurred during test..."
		}));
});

// set watch task to look for changes in test files
gulp.task('watch', function () {
	gulp.watch('spec/**/*.php', ['phpspec']);
});

// The default task (called when you run `gulp` from cli)
gulp.task('default', ['phpspec', 'watch']);