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

Commit f0491ba

Browse files
committed
Remove gulp-phpspec plugin
1 parent 5fa4b86 commit f0491ba

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

Config.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -388,20 +388,14 @@ var config = {
388388
| PHPSpec Autotesting
389389
|----------------------------------------------------------------
390390
|
391-
| Want to automatically trigger your PHPSpec tests. Not a prob!
392-
| This object stores the defaults for the path to your specs
393-
| folder, as well as any "gulp-phpspec" specific options.
391+
| Want to automatically trigger your PHPSpec tests. Not a problem.
392+
| This object stores your default PHPSpec directory path. For a
393+
| custom command, you may use the second arg to mix.phpSpec.
394394
|
395395
*/
396396

397397
phpSpec: {
398-
path: 'spec',
399-
400-
// https://www.npmjs.com/package/gulp-phpspec#api
401-
options: {
402-
verbose: 'v',
403-
notify: true
404-
}
398+
path: 'spec'
405399
}
406400
},
407401

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"gulp-less": "^3.0.3",
3939
"gulp-load-plugins": "^1.0.0-rc.1",
4040
"gulp-notify": "^2.2.0",
41-
"gulp-phpspec": "^0.5.3",
4241
"gulp-rename": "^1.2.2",
4342
"gulp-rev": "^5.1.0",
4443
"gulp-rev-replace": "^0.4.2",

tasks/phpspec.js

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
1+
var gulp = require('gulp');
12
var Elixir = require('laravel-elixir');
2-
var runTests = require('./shared/Tests');
33

44
var config = Elixir.config;
5+
var notify = new Elixir.Notification();
56

67
/*
78
|----------------------------------------------------------------
8-
| PHPSpec Testing
9+
| PHPUnit Testing
910
|----------------------------------------------------------------
1011
|
11-
| This task will trigger your entire PHPSpec test suite and it
12+
| This task will trigger your entire PHPUnit test suite and it
1213
| will show notifications indicating the success or failure
13-
| of that test suite. It's works great with the tdd task.
14+
| of that test suite. It works great with your tdd task.
1415
|
1516
*/
1617

17-
Elixir.extend('phpSpec', function(src, options) {
18-
runTests({
19-
name: 'phpSpec',
20-
src: src || (config.testing.phpSpec.path + '/**/*Spec.php'),
21-
plugin: Elixir.Plugins.phpspec,
22-
pluginOptions: options || config.testing.phpSpec.options
23-
});
18+
Elixir.extend('phpSpec', function(src, command) {
19+
src = src || (config.testing.phpSpec.path + '/**/*Spec.php'),
20+
command = command || 'vendor/bin/phpspec run';
21+
22+
new Elixir.Task('phpSpec', function(error) {
23+
Elixir.Log.heading('Triggering PHPSpec: ' + command);
24+
25+
return (
26+
gulp
27+
.src('')
28+
.pipe(Elixir.Plugins.shell(command))
29+
.on('error', function(e) {
30+
notify.forFailedTests(e, 'PHPSpec');
31+
32+
this.emit('end');
33+
})
34+
.pipe(notify.forPassedTests('PHPSpec'))
35+
);
36+
})
37+
.watch(src);
2438
});
39+

0 commit comments

Comments
 (0)