Quantcast

Add test for properly loading all of the Ovale addon files.

Johnny C. Lam [07-13-14 - 11:30]
Add test for properly loading all of the Ovale addon files.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1536 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
tests/load.t
diff --git a/tests/load.t b/tests/load.t
new file mode 100644
index 0000000..b0587cd
--- /dev/null
+++ b/tests/load.t
@@ -0,0 +1,22 @@
+--[[------------------------------
+	Load fake WoW environment.
+--]]------------------------------
+local root = "../"
+do
+	local state = {
+		class = "DRUID",
+		level = 90,
+	}
+	dofile(root .. "WoWAPI.lua")
+	WoWAPI:Initialize("Ovale", state)
+	WoWAPI:ExportSymbols()
+end
+
+do
+	-- Load all of the addon files.
+	WoWAPI:LoadAddonFile("Ovale.toc", root, true)
+
+	-- Pretend to fire ADDON_LOADED event.
+	local AceAddon = LibStub("AceAddon-3.0")
+	AceAddon:ADDON_LOADED()
+end