Skip to content

Commit

Permalink
Return the result of loading fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
y5nw authored and S-S-X committed May 10, 2022
1 parent b16dee7 commit e70f06e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,13 @@ function fixture(name)
if not _fixtures[name] then
mineunit:info("Loading fixture", path)
assert(pl.path.isfile(path), "Fixture not found: " .. path)
dofile(path)
result = {dofile(path)}
_fixtures[name] = result
return unpack(result)
else
mineunit:debug("Fixture already loaded", path)
return unpack(_fixtures[name])
end
_fixtures[name] = true
end

local function source_path(name)
Expand Down

0 comments on commit e70f06e

Please sign in to comment.