Skip to content

Commit 1f233a6

Browse files
committed
test(path): cleanup comments
1 parent c0bca33 commit 1f233a6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/plenary/path_spec.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
local Path = require "plenary.path"
22
local path = Path.path
33

4-
-- NOTE: breaking this could break tests
4+
---Construct a temporary environment which keeps track of which Paths have
5+
---been created for easier cleanup. Use `new_path()` to construct a Path.
56
local function new_env()
67
local env, trash = {}, {}
78

9+
---Create and return a new Path instance with a non-existing temporary filename,
10+
---or `opts.filename` if provided. The temporary filename will be an absolute path.
11+
---Pass `opts.touch` to create the file as well.
812
function env.new_path(opts)
913
opts = opts or {}
1014
local ret = Path:new(opts.filename or vim.fn.tempname())
@@ -16,6 +20,8 @@ local function new_env()
1620
return ret
1721
end
1822

23+
---Remove from the filesystem all paths created by `new_path()`. A
24+
---reference to this function may be passed directly to `after_each()`.
1925
function env.cleanup()
2026
for _, v in ipairs(trash) do
2127
if type((v or {}).rm) == "function" then

0 commit comments

Comments
 (0)