mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
20 lines
434 B
Lua
20 lines
434 B
Lua
local mock = require("deftest.mock.mock")
|
|
|
|
local M = {}
|
|
|
|
-- Userdata type instead of script self
|
|
function M.get_context()
|
|
return vmath.vector()
|
|
end
|
|
|
|
|
|
-- Callback for return value from function
|
|
function M.get_function(callback)
|
|
local listener = {}
|
|
listener.callback = function() if callback then return callback() end end
|
|
mock.mock(listener)
|
|
return function(...) return listener.callback(...) end, listener.callback
|
|
end
|
|
|
|
return M
|