Skip to content

Commit

Permalink
fix: prevent 'no such file or directory' error during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafaznv committed Jul 20, 2024
1 parent fffcb82 commit dc60a4b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/Unit/Laravel/Concerns/ExportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@
$result = $this->export->optimize($this->output);
expect($result->status)->toBeTrue();

$result = $this->export->setGsBinary('corrupted-gs')->optimize($this->output);
expect($result->status)->toBeFalse();
try {
$result = $this->export->setGsBinary('corrupted-gs')->optimize($this->output);

expect($result->status)->toBeFalse();
}
catch (Exception $e) {
expect($e->getMessage())
->toContain('No such file or directory')
->toContain('corrupted-gs');
}
});

it('can set logger class', function () {
Expand Down

0 comments on commit dc60a4b

Please sign in to comment.