(t *testing.T)
| 19 | } |
| 20 | |
| 21 | func 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 | |
| 37 | func TestVersionJSONOutputsVersionInfo(t *testing.T) { |
| 38 | cmd := NewVersionCommand("1.2.3") |
nothing calls this directly
no test coverage detected