} else {
expect(file_exists($this->tmpDir . $target))->toBe(true);
}
}
});
it("throws an exception if the destination directory doesn't exists", function () {
$closure = function () {
Dir::copy('spec/Fixture/Dir', 'Unexisting/Folder');
};
expect($closure)->toThrow(new Exception("Unexisting destination path `Unexisting/Folder`."));
});
});
describe("::remove()", function () {
it("removes a directory recursively", function () {
$this->tmpDir = Dir::tempnam(sys_get_temp_dir(), 'spec');
Dir::copy('spec/Fixture/Dir', $this->tmpDir);
$paths = Dir::scan('spec/Fixture/Dir');
Dir::remove($this->tmpDir);
foreach ($paths as $path) {
$target = preg_replace('~^spec~', '', $path);
expect(file_exists($this->tmpDir . $target))->toBe(false);
}
expect(file_exists($this->tmpDir))->toBe(false);
});
});
describe("::make()", function () {
beforeEach(function () {
$this->umask = umask(0);
$this->tmpDir = Dir::tempnam(sys_get_temp_dir(), 'spec');
});
afterEach(function () {