Repository navigation
Expand file tree
/
Copy pathspelldb_spec.lua
More file actions
56 lines (56 loc) · 1.58 KB
/
Copy pathspelldb_spec.lua
File metadata and controls
56 lines (56 loc) · 1.58 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
describe('spell db', function()
it('knows about all spell actions', function()
local knownBad = {
['!Auto Shot'] = true,
['!Shoot'] = true,
['Adrenaline Rush'] = true,
['Blade Flurry'] = true,
['Cold Snap'] = true,
['Desperate Prayer'] = true,
['Disarm Trap'] = true,
['Divine Intervention'] = true,
['Divine Favor'] = true,
['Evocation'] = true,
['Inner Focus'] = true,
['Lay on Hands'] = true,
['Pick Lock'] = true,
['Pick Pocket'] = true,
['Poisons'] = true,
['Shadowform'] = true,
['Stealth'] = true,
}
if wow.env.WOW_PROJECT_ID == 2 then
knownBad.Fishing = true
knownBad.Innervate = true
knownBad['Nature\'s Swiftness'] = true
end
local seenBad = {}
for fullname, spec in pairs(wow.addon.ClassActionSpecs) do
for _, actions in ipairs(spec) do
for _, action in pairs(actions) do
if action.spell then
if knownBad[action.spell] then
seenBad[action.spell] = true
elseif not wow.addon.SpellDB[action.spell] then
error(fullname .. ': ' .. action.spell)
end
end
end
end
end
assert.same(knownBad, seenBad)
end)
it('does not duplicate spell ids', function()
local actual = {}
for name, ranks in pairs(wow.addon.SpellDB) do
local ids = {}
for _, rank in ipairs(ranks) do
if ids[rank[1]] then
actual[name] = true
end
ids[rank[1]] = true
end
end
assert.same({}, actual)
end)
end)