-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile
32 lines (24 loc) · 841 Bytes
/
Taskfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require 'vendor/autoload.php';
use Task\Plugin\PhpSpecPlugin;
use Task\Plugin\WatchPlugin;
$project = new Task\Project('task/filesystem');
$project->inject(function ($container) {
$container['phpspec'] = new PhpSpecPlugin;
$container['watch'] = new WatchPlugin;
});
$project->addTask('test', ['phpspec', function ($phpspec) {
$phpspec->command('run')
->setConfig($this->getProperty('config', 'phpspec.yml'))
->setFormat('pretty')
->pipe($this->getOutput());
}]);
$project->addTask('test.watch', ['watch', 'phpspec', function ($watch, $phpspec) use ($project) {
$output = $this->getOutput();
$watch->init('spec/')
->addListener('modify', function () use ($project, $output) {
$project->runTask('test', $output);
})
->start();
}]);
return $project;