open-nomad/command/system_gc_test.go
2020-10-05 16:07:41 +02:00

28 lines
551 B
Go

package command
import (
"testing"
"github.com/mitchellh/cli"
)
func TestSystemGCCommand_Implements(t *testing.T) {
t.Parallel()
var _ cli.Command = &SystemGCCommand{}
}
func TestSystemGCCommand_Good(t *testing.T) {
t.Parallel()
// Create a server
srv, _, url := testServer(t, true, nil)
defer srv.Shutdown()
ui := cli.NewMockUi()
cmd := &SystemGCCommand{Meta: Meta{Ui: ui, flagAddress: url}}
if code := cmd.Run([]string{"-address=" + url}); code != 0 {
t.Fatalf("expected exit 0, got: %d; %v", code, ui.ErrorWriter.String())
}
}