(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func TestOutputReturnsCommandOutput(t *testing.T) { |
| 35 | // Given a command that writes to standard output |
| 36 | cmd := createCommand(t, 0, "hello world", "") |
| 37 | command := Command{cmd} |
| 38 | |
| 39 | // When its output is captured |
| 40 | out, err := command.Output() |
| 41 | |
| 42 | // Then the output is returned without an error |
| 43 | require.NoError(t, err) |
| 44 | assert.Equal(t, "hello world", string(out)) |
| 45 | } |
| 46 | |
| 47 | func TestOutputReturnsGitError(t *testing.T) { |
| 48 | // Given a command that fails with Git's not-a-repository diagnostic |
nothing calls this directly
no test coverage detected