Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .busted
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
return {
_all = {
},
default = {
verbose = true,
lpath = "Parser/?.lua;Utils/?.lua;Locale/?.lua",
ROOT = {"."},
recursive = true,
pattern = "_spec.lua",
},
}
31 changes: 31 additions & 0 deletions Locale/en_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
describe("pre test", function()
it("should be able to load en", function()
stub(_G, "L")
assert.is.truthy(require('en'))
end)
it("should load constants", function()
assert.is.truthy(require('Enums'))
end)
end)

describe("en tests", function()
setup(function ()
require('en')
require('Enums')
end)
describe("parsing tests", function()
it("should read consts", function()
assert.are.same({"Death","Death"},L["Death"])
end)
it("should parse basic hit", function()
-- body
input = "Gandalf scored a hit on Balrog for 10 damage to Balrog%."
eventType, initiatorName, targetName, skillName, amount, avoidType, critType, dmgType = L["Parse"](input)
assert.is.equal(event_type.DMG_DEALT,eventType)
assert.is.equal("Gandalf",initiatorName)
assert.is.equal("Balrog", targetName)
assert.is.equal(L["DirectDamage"], skillName)
assert.is.equal(10, amount)
end)
end)
end)
15 changes: 15 additions & 0 deletions Parser/Parser_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
describe("pre test", function()
it("should be able to load Parser", function()
stub(_G, "L")
stub(_G, "Misc")
stub(_G.Misc, "AddCallback")
stub(_G, "Turbine")
stub(_G.Turbine, "UI")
stub(_G.Turbine.UI, "Control", {parserControl = {}})

assert.is.truthy(require('Parser'))
end)
it("should load constants", function()
assert.is.truthy(require('Enums'))
end)
end)