server: Return proper version
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"code.severnaya.net/kordophone-mock/v2/model"
|
||||
)
|
||||
|
||||
const VERSION = "Kordophone-2.0"
|
||||
|
||||
type Server struct {
|
||||
version string
|
||||
conversations []model.Conversation
|
||||
@@ -12,7 +14,7 @@ type Server struct {
|
||||
|
||||
func NewServer() *Server {
|
||||
return &Server{
|
||||
version: "1.0",
|
||||
version: VERSION,
|
||||
conversations: []model.Conversation{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"code.severnaya.net/kordophone-mock/v2/model"
|
||||
"code.severnaya.net/kordophone-mock/v2/server"
|
||||
"code.severnaya.net/kordophone-mock/v2/web"
|
||||
)
|
||||
|
||||
@@ -25,7 +26,7 @@ func TestVersion(t *testing.T) {
|
||||
t.Fatalf("Error decoding body: %s", body)
|
||||
}
|
||||
|
||||
if string(body) != "1.0" {
|
||||
if string(body) != server.VERSION {
|
||||
t.Fatalf("Unexpected return value: %s (expected %s)", body, "1.0")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user