feat: 重构项目结构,添加命令处理程序并移除冗余文件

This commit is contained in:
Rogee
2025-09-12 19:43:06 +08:00
parent 4c8205212f
commit dd097e9aec
12 changed files with 6 additions and 61 deletions

View File

@@ -0,0 +1,30 @@
package testx
import (
"os"
"testing"
"go.ipao.vip/atom"
"go.ipao.vip/atom/container"
"github.com/rogeecn/fabfile"
. "github.com/smartystreets/goconvey/convey"
)
func Default(providers ...container.ProviderContainer) container.Providers {
return append(container.Providers{}, providers...)
}
func Serve(providers container.Providers, t *testing.T, invoke any) {
Convey("tests boot up", t, func() {
file := fabfile.MustFind("config.toml")
localEnv := os.Getenv("ENV_LOCAL")
if localEnv != "" {
file = fabfile.MustFind("config." + localEnv + ".toml")
}
So(atom.LoadProviders(file, providers), ShouldBeNil)
So(container.Container.Invoke(invoke), ShouldBeNil)
})
}