INNER CODE UNIT · Go
TestListNamesCommand
cristianoliveira/ergo · main_test.go:127
func TestListNamesCommand(t *testing.T) {
services := map[string]proxy.Service{
"foo": proxy.UnsafeNewService("foo", "http://localhost:3000"),
"bar": proxy.UnsafeNewService("bar", "http://localhost:5000"),
}
t.Run("list names services", func(tt *testing.T) {
args := []string{"ergo", "list-names"}
expectedOutput := "Ergo Proxy current list"
command, config := prepareSubCommand(args)
config.Services = services
if command == nil {
tt.Fatal("Expected command to not be nil")
}
output, err := command.Execute(config)