INNER CODE UNIT · Go

TestListCommand

cristianoliveira/ergo · main_test.go:99

func TestListCommand(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 services", func(tt *testing.T) {
		args := []string{"ergo", "list"}
		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)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…