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);