Skip to content

Commit

Permalink
Test that .git directory is preserved when exporting with —clear.
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseleite committed Feb 26, 2025
1 parent dd8f37b commit 17a5f0d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/StarterKits/ExportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ public function it_can_clear_target_export_path_with_clear_option()
base_path('two'),
]);

// Imagine this exists from previous export
// Imagine we already have a target a git repo
$this->files->makeDirectory($this->targetPath('.git'), 0777, true, true);
$this->files->put($this->targetPath('.git/config'), 'Config.');

// And imagine this exists from previous export
$this->files->makeDirectory($this->exportPath('one'), 0777, true, true);
$this->files->put($this->exportPath('one/file.md'), 'One.');

Expand All @@ -195,10 +199,13 @@ public function it_can_clear_target_export_path_with_clear_option()

$this->exportCoolRunnings(['--clear' => true]);

// But 'one' folder should exist after exporting with `--clear` option
// Our 'one' folder shouldn't exist after exporting with `--clear` option
$this->assertFileDoesNotExist($this->exportPath('one'));
$this->assertFileExists($this->exportPath('two'));

// But it should not clear `.git` directory
$this->assertFileExists($this->targetPath('.git/config'));

$this->exportCoolRunnings();

$this->cleanPaths($paths);
Expand Down

0 comments on commit 17a5f0d

Please sign in to comment.