Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Commit

Permalink
Remove gulp-phpspec plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyWay committed Feb 7, 2016
1 parent 5fa4b86 commit f0491ba
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
14 changes: 4 additions & 10 deletions Config.js
Expand Up @@ -388,20 +388,14 @@ var config = {
| PHPSpec Autotesting
|----------------------------------------------------------------
|
| Want to automatically trigger your PHPSpec tests. Not a prob!
| This object stores the defaults for the path to your specs
| folder, as well as any "gulp-phpspec" specific options.
| Want to automatically trigger your PHPSpec tests. Not a problem.
| This object stores your default PHPSpec directory path. For a
| custom command, you may use the second arg to mix.phpSpec.
|
*/

phpSpec: {
path: 'spec',

// https://www.npmjs.com/package/gulp-phpspec#api
options: {
verbose: 'v',
notify: true
}
path: 'spec'
}
},

Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -38,7 +38,6 @@
"gulp-less": "^3.0.3",
"gulp-load-plugins": "^1.0.0-rc.1",
"gulp-notify": "^2.2.0",
"gulp-phpspec": "^0.5.3",
"gulp-rename": "^1.2.2",
"gulp-rev": "^5.1.0",
"gulp-rev-replace": "^0.4.2",
Expand Down
37 changes: 26 additions & 11 deletions tasks/phpspec.js
@@ -1,24 +1,39 @@
var gulp = require('gulp');
var Elixir = require('laravel-elixir');
var runTests = require('./shared/Tests');

var config = Elixir.config;
var notify = new Elixir.Notification();

/*
|----------------------------------------------------------------
| PHPSpec Testing
| PHPUnit Testing
|----------------------------------------------------------------
|
| This task will trigger your entire PHPSpec test suite and it
| This task will trigger your entire PHPUnit test suite and it
| will show notifications indicating the success or failure
| of that test suite. It's works great with the tdd task.
| of that test suite. It works great with your tdd task.
|
*/

Elixir.extend('phpSpec', function(src, options) {
runTests({
name: 'phpSpec',
src: src || (config.testing.phpSpec.path + '/**/*Spec.php'),
plugin: Elixir.Plugins.phpspec,
pluginOptions: options || config.testing.phpSpec.options
});
Elixir.extend('phpSpec', function(src, command) {
src = src || (config.testing.phpSpec.path + '/**/*Spec.php'),
command = command || 'vendor/bin/phpspec run';

new Elixir.Task('phpSpec', function(error) {
Elixir.Log.heading('Triggering PHPSpec: ' + command);

return (
gulp
.src('')
.pipe(Elixir.Plugins.shell(command))
.on('error', function(e) {
notify.forFailedTests(e, 'PHPSpec');

this.emit('end');
})
.pipe(notify.forPassedTests('PHPSpec'))
);
})
.watch(src);
});

0 comments on commit f0491ba

Please sign in to comment.