mirror of
https://github.com/kikito/lua-sandbox.git
synced 2024-12-18 03:04:20 +00:00
tests - add test for overriding base env with false
This commit is contained in:
parent
26553beec7
commit
3f11f19ba3
@ -135,6 +135,11 @@ describe('sandbox.run', function()
|
|||||||
local env = { tostring = function(x) return "hello " .. x end }
|
local env = { tostring = function(x) return "hello " .. x end }
|
||||||
assert.equal("hello peter", sandbox.run("return tostring('peter')", { env = env }))
|
assert.equal("hello peter", sandbox.run("return tostring('peter')", { env = env }))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('can override the base env with false', function()
|
||||||
|
local env = { tostring = false }
|
||||||
|
assert.equal(false, sandbox.run("return tostring", { env = env }))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user