Skip to content

Commit 18ec5d3

Browse files
committed
test(SoarTest): Remove OS check for help option skip
- Remove the skip condition for the help option test on Windows. - This allows the test to run on Windows, ensuring coverage for that platform. - Updated to improve cross-platform compatibility for the Soar help option.
1 parent cf9f843 commit 18ec5d3

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Concerns/WithRunable.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*/
2121
trait WithRunable
2222
{
23+
protected Process $process;
24+
2325
/** @var null|callable */
2426
protected $processTapper;
2527

@@ -56,6 +58,6 @@ protected function toProcess(): Process
5658
($this->processTapper)($process);
5759
}
5860

59-
return $process;
61+
return $this->process = $process;
6062
}
6163
}

src/Soar.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public function __construct(array $options = [], ?string $soarBinary = null)
4444
*/
4545
public function help(): string
4646
{
47-
return $this->clone()->setHelp(true)->run();
47+
$soar = $this->clone();
48+
49+
return $soar->setHelp(true)->run() ?: $soar->process->getErrorOutput();
4850
}
4951

5052
/**

tests/SoarTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
it('can get help', function (): void {
2626
expect(Soar::make())->help()->toContain('-version');
27-
})->group(__DIR__, __FILE__)->skip(OS::isWindows(), 'The help option of Soar is not supported on Windows.');
27+
})->group(__DIR__, __FILE__);
2828

2929
it('can get help snapshot', function (): void {
3030
assertMatchesTextSnapshot(

0 commit comments

Comments
 (0)