Skip to content

Commit

Permalink
Fix failing windows tests (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond authored Nov 6, 2024
1 parent 18bbdf5 commit 28db7cf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/TailwindBinaryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Process\Process;
use Symfony\Contracts\Cache\CacheInterface;
use Symfonycasts\TailwindBundle\TailwindBinary;

Expand All @@ -34,13 +35,11 @@ public function testBinaryIsDownloadedAndProcessCreated()

$binary = new TailwindBinary($binaryDownloadDir, __DIR__, null, 'fake-version', $cache, null, $client);
$process = $binary->createProcess(['-i', 'fake.css']);
$this->assertFileExists($binaryDownloadDir.'/fake-version/'.TailwindBinary::getBinaryName());

// Windows doesn't wrap arguments in quotes
$expectedTemplate = '\\' === \DIRECTORY_SEPARATOR ? '"%s" -i fake.css' : "'%s' '-i' 'fake.css'";
$binaryFile = $binaryDownloadDir.'/fake-version/'.TailwindBinary::getBinaryName();
$this->assertFileExists($binaryFile);

$this->assertSame(
\sprintf($expectedTemplate, $binaryDownloadDir.'/fake-version/'.TailwindBinary::getBinaryName()),
(new Process([$binaryFile, '-i', 'fake.css'], __DIR__))->getCommandLine(),
$process->getCommandLine()
);
}
Expand Down

0 comments on commit 28db7cf

Please sign in to comment.