diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-11 08:55:50 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-11 09:50:19 +0200 |
commit | 1e233b1c4598fd8cbce7da8a67bf2c4918c6047e (patch) | |
tree | d3155c4a36c06036f95bc9694d04c35b5bf85b5f /commands/server_test.go | |
parent | b110d0ae04e13fb45c739bcebb580709745082e6 (diff) |
commands: Fix TestFixURL
See #4598
Diffstat (limited to 'commands/server_test.go')
-rw-r--r-- | commands/server_test.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/commands/server_test.go b/commands/server_test.go index 396b86766..8940eb078 100644 --- a/commands/server_test.go +++ b/commands/server_test.go @@ -13,12 +13,13 @@ package commands -// "testing" +import ( + "testing" -// "github.com/spf13/viper" + "github.com/spf13/viper" +) -// TODO(bep) cli refactor fix me -/*func TestFixURL(t *testing.T) { +func TestFixURL(t *testing.T) { type data struct { TestName string CLIBaseURL string @@ -41,12 +42,13 @@ package commands } for i, test := range tests { + s := newServerCmd() v := viper.New() - baseURL = test.CLIBaseURL + baseURL := test.CLIBaseURL v.Set("baseURL", test.CfgBaseURL) - serverAppend = test.AppendPort - serverPort = test.Port - result, err := fixURL(v, baseURL, serverPort) + s.serverAppend = test.AppendPort + s.serverPort = test.Port + result, err := s.fixURL(v, baseURL, s.serverPort) if err != nil { t.Errorf("Test #%d %s: unexpected error %s", i, test.TestName, err) } @@ -55,4 +57,3 @@ package commands } } } -*/ |