Esempio n. 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;")
})
Esempio n. 2
0
File: main.go Progetto: ramigg/ok-go
func main() {
	app := config.NewApp(".")
	routes.Setup(app)
	app.Negroni.Run(":" + os.Getenv("PORT"))
}