photoprism/internal/test/capture_test.go
Michael Mayer 9872cfaa50 Add ConfigCommand test #58
- Includes refactoring of existing packages to enable testing of commands
2018-11-17 13:57:19 +01:00

19 lines
254 B
Go

package test
import (
"fmt"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCapture(t *testing.T) {
result := Capture(func() {
fmt.Fprint(os.Stdout, "foo")
fmt.Fprint(os.Stderr, "bar")
})
assert.Equal(t, "foobar", result)
}