From 3f11f19ba31301a9ff61b9a57c6d667c7e652d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Garci=CC=81a=20Cota?= Date: Thu, 7 Jan 2021 18:32:29 +0100 Subject: [PATCH] tests - add test for overriding base env with false --- spec/sandbox_spec.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/sandbox_spec.lua b/spec/sandbox_spec.lua index eaacfa2..fac19f4 100644 --- a/spec/sandbox_spec.lua +++ b/spec/sandbox_spec.lua @@ -135,6 +135,11 @@ describe('sandbox.run', function() local env = { tostring = function(x) return "hello " .. x end } assert.equal("hello peter", sandbox.run("return tostring('peter')", { env = env })) 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)