Explorar o código

Added TestGETNoServer

Piotr Czajkowski %!s(int64=4) %!d(string=hai) anos
pai
achega
8dec70b522
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      rest_test.go

+ 11 - 0
rest_test.go

@@ -107,3 +107,14 @@ func TestGET404(t *testing.T) {
 		t.Errorf("Wrong result, %v", resultString)
 	}
 }
+
+func TestGETNoServer(t *testing.T) {
+	data, err := GET("/")
+	if data != nil {
+		t.Error("Data should be nil!")
+	}
+
+	if err == nil {
+		t.Error("There should be an error!")
+	}
+}