mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-24 21:34:42 +01:00
SAVEPOINT
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user