test: add for utils
* Add tests only for gopher._utils.empty()
This commit is contained in:
parent
149e89eab4
commit
7587555fa9
1 changed files with 19 additions and 0 deletions
19
spec/gopher_utils_spec.lua
Normal file
19
spec/gopher_utils_spec.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
describe("gopher._utils", function()
|
||||||
|
it("can be requried", function()
|
||||||
|
require "gopher._utils"
|
||||||
|
end)
|
||||||
|
|
||||||
|
it(".empty() with non-empty talbe", function()
|
||||||
|
local empty = require("gopher._utils").empty
|
||||||
|
local res = empty { first = "1", second = 2 }
|
||||||
|
|
||||||
|
assert.are.same(res, false)
|
||||||
|
end)
|
||||||
|
|
||||||
|
it(".empty() with empty talbe", function()
|
||||||
|
local empty = require("gopher._utils").empty
|
||||||
|
local res = empty {}
|
||||||
|
|
||||||
|
assert.are.same(res, true)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue