From 932cfca8341575b5ccfbe0e44e35dc648ef10642 Mon Sep 17 00:00:00 2001 From: lrodham Date: Sat, 11 Nov 2017 13:36:00 +0000 Subject: [PATCH] SAVEPOINT --- default_router_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/default_router_test.go b/default_router_test.go index b127ab8..d6c06d1 100644 --- a/default_router_test.go +++ b/default_router_test.go @@ -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) +}