SAVEPOINT

This commit is contained in:
2017-11-11 13:36:00 +00:00
parent 57af3d95d0
commit 932cfca834

View File

@@ -1,6 +1,7 @@
package tuu_test
import (
"net/http"
"testing"
"github.com/stretchr/testify/require"
@@ -19,3 +20,16 @@ func Test_Route_Creation(t *testing.T) {
r.Equal("GET", route.Method)
r.Equal("/testing", route.Path)
}
func Test_Static_Route_Creation(t *testing.T) {
r := require.New(t)
dir := "test_dir"
router := tuu.NewRouter()
router.Static("/test-path", http.Dir(dir))
routes := router.GetStaticRoutes()
r.Len(routes, 1)
route := routes[0]
r.Equal("/test-path", route.Path)
}