mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-13 09:51:58 -04:00
tests
This commit is contained in:
parent
dff068d75b
commit
e8c7fde4c3
8 changed files with 95 additions and 20 deletions
12
api.spec.lua
Normal file
12
api.spec.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
mtt.register("send mail", function(callback)
|
||||
-- send a mail
|
||||
local success, err = mail.send({from = "player1", to = "player2", subject = "something", body = "blah"})
|
||||
assert(success)
|
||||
assert(not err)
|
||||
|
||||
-- check the receivers inbox
|
||||
local entry = mail.get_storage_entry("player2")
|
||||
assert(entry)
|
||||
assert(#entry.inbox > 0)
|
||||
callback()
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue