feat: adds --version option

This commit is contained in:
Nuno Maduro
2020-06-26 18:17:11 +02:00
parent cb4c9563bd
commit 9ea51caf3f
5 changed files with 88 additions and 9 deletions

View File

@ -88,12 +88,12 @@
WARN Tests\Features\Skip
✓ it do not skips
s it skips with truthy
s it skips with truthy condition by default
s it skips with message → skipped because bar
s it skips with truthy closure condition
- it skips with truthy
- it skips with truthy condition by default
- it skips with message → skipped because bar
- it skips with truthy closure condition
✓ it do not skips with falsy closure condition
s it skips with condition and message → skipped because foo
- it skips with condition and message → skipped because foo
PASS Tests\Features\Test
✓ a test
@ -135,6 +135,10 @@
✓ it throws exception when `process isolation` is true
✓ it do not throws exception when `process isolation` is false
PASS Tests\Unit\Plugins\Version
✓ it outputs the version when --version is used
✓ it do not outputs version when --version is not used
PASS Tests\Unit\Support\Backtrace
✓ it gets file name from called file
@ -161,7 +165,7 @@
✓ it disable decorating printer when colors is set to never
WARN Tests\Visual\Success
s visual snapshot of test suite on success
- visual snapshot of test suite on success
Tests: 6 skipped, 94 passed
Time: 3.73s
Tests: 6 skipped, 96 passed
Time: 3.56s

View File

@ -0,0 +1,20 @@
<?php
use Pest\Plugins\Version;
use Symfony\Component\Console\Output\BufferedOutput;
it('outputs the version when --version is used', function () {
$output = new BufferedOutput();
$plugin = new Version($output);
$plugin->handleArguments(['foo', '--version']);
assertEquals("Pest 0.2.2\n", $output->fetch());
});
it('do not outputs version when --version is not used', function () {
$output = new BufferedOutput();
$plugin = new Version($output);
$plugin->handleArguments(['foo', 'bar']);
assertEquals('', $output->fetch());
});