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:
@@ -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
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user