1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

Provide inbucket object in Lua (#351)

* fix delve fortify thingy
* Expose inbucket.after.message_stored in lua
* Expose inbucket.after.message_deleted in lua
* Expose inbucket.before.mail_accepted in lua
This commit is contained in:
James Hillyerd
2023-02-27 20:22:10 -08:00
committed by GitHub
parent 95281566f6
commit 5a886813c3
6 changed files with 344 additions and 37 deletions

View File

@@ -65,7 +65,7 @@ func TestAfterMessageDeleted(t *testing.T) {
script := `
async = true
function after_message_deleted(msg)
function inbucket.after.message_deleted(msg)
-- Full message bindings tested elsewhere.
assert_eq(msg.mailbox, "mb1")
assert_eq(msg.id, "id1")
@@ -96,7 +96,7 @@ func TestAfterMessageStored(t *testing.T) {
script := `
async = true
function after_message_stored(msg)
function inbucket.after.message_stored(msg)
-- Full message bindings tested elsewhere.
assert_eq(msg.mailbox, "mb1")
assert_eq(msg.id, "id1")
@@ -125,7 +125,7 @@ func TestAfterMessageStored(t *testing.T) {
func TestBeforeMailAccepted(t *testing.T) {
// Register lua event listener.
script := `
function before_mail_accepted(localpart, domain)
function inbucket.before.mail_accepted(localpart, domain)
return localpart == "from" and domain == "test"
end
`