Moved test files to testdata folder.

Changed the tests accordingly.
This commit is contained in:
Maxime
2015-07-23 09:35:46 +02:00
parent 2df30d186e
commit bc2feece4b
18 changed files with 18 additions and 9 deletions

View File

@ -6,15 +6,16 @@ import (
"strings"
"testing"
"github.com/mholt/caddy/middleware"
"github.com/russross/blackfriday"
)
func TestMarkdown(t *testing.T) {
templates := make(map[string]string)
templates[DefaultTemplate] = "markdown_tpl.html"
templates[DefaultTemplate] = "testdata/markdown_tpl.html"
md := Markdown{
Root: "/blog",
FileSys: http.Dir("."),
Root: "./testdata",
FileSys: http.Dir("./testdata"),
Configs: []Config{
Config{
Renderer: blackfriday.HtmlRenderer(0, "", ""),
@ -34,6 +35,10 @@ func TestMarkdown(t *testing.T) {
},
},
IndexFiles: []string{"index.html"},
Next: middleware.HandlerFunc(func(w http.ResponseWriter, r *http.Request) (int, error) {
t.Fatalf("Next shouldn't be called")
return 0, nil
}),
}
req, err := http.NewRequest("GET", "/blog/test.md", nil)