Created
February 22, 2014 22:53
-
-
Save mikeerickson/9163621 to your computer and use it in GitHub Desktop.
Gulp PHPSpec automated testing ....
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.