This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fa4b86
commit f0491ba
Showing
3 changed files
with
30 additions
and
22 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}); | ||
|