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

chore: create Lua test helper (#532)

* Create lua test helper

Signed-off-by: James Hillyerd <james@hillyerd.com>

* Assert labels

Signed-off-by: James Hillyerd <james@hillyerd.com>

---------

Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
James Hillyerd
2024-09-29 11:46:01 -07:00
committed by GitHub
parent b1b7e4b07c
commit 5284171dc5
6 changed files with 135 additions and 117 deletions

View File

@@ -3,8 +3,8 @@ package luahost
import (
"testing"
"github.com/inbucket/inbucket/v3/pkg/test"
"github.com/stretchr/testify/require"
lua "github.com/yuin/gopher-lua"
)
func TestInbucketAfterFuncs(t *testing.T) {
@@ -49,7 +49,7 @@ func TestInbucketAfterFuncs(t *testing.T) {
end
`
ls := lua.NewState()
ls, _ := test.NewLuaState()
registerInbucketTypes(ls)
require.NoError(t, ls.DoString(script))
}
@@ -96,7 +96,7 @@ func TestInbucketBeforeFuncs(t *testing.T) {
end
`
ls := lua.NewState()
ls, _ := test.NewLuaState()
registerInbucketTypes(ls)
require.NoError(t, ls.DoString(script))
}