MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestVersionTextUsesCommandOutput

Function TestVersionTextUsesCommandOutput

cmd/version_test.go:21–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19}
20
21func TestVersionTextUsesCommandOutput(t *testing.T) {
22 cmd := NewVersionCommand("1.2.3")
23 stdout := &bytes.Buffer{}
24 cmd.SetOut(stdout)
25 stubDropboxVersion(t, "sdk-test", "spec-test")
26
27 if err := versionCommand(cmd, "1.2.3"); err != nil {
28 t.Fatalf("versionCommand returned error: %v", err)
29 }
30
31 want := "dbxcli version: 1.2.3\nSDK version: sdk-test\nSpec version: spec-test\n"
32 if got := stdout.String(); got != want {
33 t.Fatalf("stdout = %q, want %q", got, want)
34 }
35}
36
37func TestVersionJSONOutputsVersionInfo(t *testing.T) {
38 cmd := NewVersionCommand("1.2.3")

Callers

nothing calls this directly

Calls 3

NewVersionCommandFunction · 0.85
stubDropboxVersionFunction · 0.85
versionCommandFunction · 0.85

Tested by

no test coverage detected