about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--dispatcher_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/dispatcher_test.go b/dispatcher_test.go
new file mode 100644
index 0000000..845833c
--- /dev/null
+++ b/dispatcher_test.go
@@ -0,0 +1,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()
+	}
+}