mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-30 14:38:41 +01:00
SAVEPOINT
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package tuu_test
|
package tuu_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
@@ -19,3 +20,16 @@ func Test_Route_Creation(t *testing.T) {
|
|||||||
r.Equal("GET", route.Method)
|
r.Equal("GET", route.Method)
|
||||||
r.Equal("/testing", route.Path)
|
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)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user