Skip to content

Instantly share code, notes, and snippets.

@carnar
Forked from laracasts/Gulpfile.js
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carnar/922c93cbe0d8a7806bc7 to your computer and use it in GitHub Desktop.
Save carnar/922c93cbe0d8a7806bc7 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var phpspec = require('gulp-phpspec');
var run = require('gulp-run');
var notify = require('gulp-notify');
gulp.task('test', function() {
gulp.src('spec/**/*.php')
.pipe(run('clear').exec())
.pipe(phpspec('', { notify: true }))
.on('error', notify.onError({
title: 'Dangit',
message: 'Your tests failed!',
icon: __dirname + '/fail.png'
}))
.pipe(notify({
title: 'Success',
message: 'All tests have returned green!'
}));
});
gulp.task('watch', function() {
gulp.watch(['spec/**/*.php', 'src/**/*.php'], ['test']);
});
gulp.task('default', ['test', 'watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment