Skip to content

Instantly share code, notes, and snippets.

@mikeerickson
Created February 22, 2014 22:53
Show Gist options
  • Save mikeerickson/9163621 to your computer and use it in GitHub Desktop.
Save mikeerickson/9163621 to your computer and use it in GitHub Desktop.
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']);
@Dalamar
Copy link

Dalamar commented Apr 5, 2015

Would it be great if we had the way to trigger a class' associated test upon save...
If following a TDD cycle, we are surely need to have this option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment