mirror of
https://github.com/onyx-and-iris/gobs-cli.git
synced 2025-06-09 21:20:34 +01:00
31 lines
653 B
Go
31 lines
653 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestVersion(t *testing.T) {
|
|
client, disconnect := getClient(t)
|
|
defer disconnect()
|
|
|
|
var out bytes.Buffer
|
|
context := &context{
|
|
Client: client,
|
|
Out: &out,
|
|
}
|
|
|
|
cmd := &VersionCmd{}
|
|
err := cmd.Run(context)
|
|
if err != nil {
|
|
t.Fatalf("Failed to get version: %v", err)
|
|
}
|
|
if !strings.Contains(out.String(), "OBS Client Version:") {
|
|
t.Fatalf("Expected output to contain 'OBS Client Version:', got '%s'", out.String())
|
|
}
|
|
if !strings.Contains(out.String(), "with Websocket Version:") {
|
|
t.Fatalf("Expected output to contain 'with Websocket Version:', got '%s'", out.String())
|
|
}
|
|
}
|