Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
cd2b255a
Commit
cd2b255a
authored
Jul 03, 2015
by
Matt Holt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #177 from Karthic-Hackintosh/master
preliminary test case for config/setup/markdown.go
parents
a86e16dd
93f29a75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
config/setup/markdown_test.go
config/setup/markdown_test.go
+33
-0
No files found.
config/setup/markdown_test.go
0 → 100644
View file @
cd2b255a
package
setup
import
(
"github.com/mholt/caddy/middleware/markdown"
"testing"
)
func
TestMarkdown
(
t
*
testing
.
T
)
{
c
:=
NewTestController
(
`markdown /blog`
)
mid
,
err
:=
Markdown
(
c
)
if
err
!=
nil
{
t
.
Errorf
(
"Expected no errors, got: %v"
,
err
)
}
if
mid
==
nil
{
t
.
Fatal
(
"Expected middleware, was nil instead"
)
}
handler
:=
mid
(
EmptyNext
)
myHandler
,
ok
:=
handler
.
(
markdown
.
Markdown
)
if
!
ok
{
t
.
Fatalf
(
"Expected handler to be type Markdown, got: %#v"
,
handler
)
}
if
myHandler
.
Configs
[
0
]
.
PathScope
!=
"/blog"
{
t
.
Errorf
(
"Expected /blog as the Path Scope"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment