Sandbox.setPath

Undocumented in source. Be warned that the author may not have intended to support it.
struct Sandbox
static
void
setPath
(
string path
)

Examples

import std.file;
import std.path;
import unit_threaded.should;

Sandbox.sandboxPath.shouldEqual(defaultSandboxPath);

immutable newPath = buildPath("foo", "bar", "baz");
assert(!newPath.exists);
Sandbox.setPath(newPath);
assert(newPath.exists);
scope(exit) () @trusted { rmdirRecurse("foo"); }();
Sandbox.sandboxPath.shouldEqual(newPath);

with(immutable Sandbox()) {
    writeFile("newPath.txt");
    assert(buildPath(newPath, testPath, "newPath.txt").exists);
}

Sandbox.resetPath;
Sandbox.sandboxPath.shouldEqual(defaultSandboxPath);

Meta