示例#1
0
import (
	"github.com/joho/godotenv"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/runemadsen/ok-go/config"
	"testing"
)

var (
	app *config.App
)

func TestTest(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "Test Suite")
}

var _ = BeforeSuite(func() {

	// Load test ENV variables
	godotenv.Load("../.env.test")

	// Create a new app
	app = config.NewApp("../.")
})

var _ = BeforeEach(func() {
	// Reset the DB before every test
	app.DB.Exec("DELETE FROM posts;")
})
示例#2
0
文件: main.go 项目: ramigg/ok-go
func main() {
	app := config.NewApp(".")
	routes.Setup(app)
	app.Negroni.Run(":" + os.Getenv("PORT"))
}