about summary refs log tree commit diff
path: root/dispatcher_test.go
blob: 845833c7a732ee6acd971a0db2d7f150ac0e1574 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package mooh

import (
	"testing"
)

func testDispatcher (req *Request) (Response, error) {
	resp := Response{}
	return resp, nil
}

func testBasic(t *testing.T) {
	d := BuildDispatcher()
	err := d.AddRoute(&Route{Method:"GET", Path:"/", Code: testDispatcher})
	if err != nil {
		t.Fatal()
	}
	err = d.AddRoute(&Route{Method: "GET", Path:"/", Code: testDispatcher})
	if err == nil {
		t.Fatal()
	}
}