forked from Roblox/cryo
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.spec.lua
More file actions
60 lines (55 loc) · 1.15 KB
/
init.spec.lua
File metadata and controls
60 lines (55 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
local equalsDeep = require(script.Parent.equalsDeep)
local function toString(t)
if type(t) == "table" then
local fields = {}
for i, v in pairs(t) do
local field = if type(i) == "number" then toString(v) else toString(i) .. "=" .. toString(v)
table.insert(fields, field)
end
return "{" .. table.concat(fields, ", ") .. "}"
else
return tostring(t)
end
end
return function()
beforeAll(function()
expect.extend({
toEqual = function(a, b)
if a == b then
return {
pass = true,
message = "Expected to not equal",
}
end
if equalsDeep(a, b) then
return {
pass = true,
message = "Expected to not equal",
}
else
return {
pass = false,
message = string.format(
"Does not equal.\n\t\tGot: %q\n\t\tExpected: %q\n\n",
toString(a),
toString(b)
),
}
end
end,
toBe = function(a, b)
return {
pass = a == b,
message = string.format(
"Does not equal.\n\t\tGot: %q\n\t\tExpected: %q\n\n",
toString(a),
toString(b)
),
}
end,
})
end)
it("should load", function()
require(script.Parent)
end)
end