test(_utils): test .sreq method

This commit is contained in:
Smirnov Oleksandr 2023-07-05 13:55:28 +03:00
parent 9204f3ee8d
commit 82e739d823

View file

@ -12,4 +12,18 @@ describe("gopher._utils", function()
assert.are.same(res, true) assert.are.same(res, true)
end) end)
end) end)
describe(".sreq()", function()
local sreq = require("gopher._utils").sreq
it("return module if it exists", function()
assert.are.same(sreq "gopher", require "gopher")
end)
it("throw error if it doesn't exist", function()
assert.has.errors(function()
sreq "no_existing_module"
end)
end)
end)
end) end)