diff options
Diffstat (limited to 'stdout/stdout_test.go')
-rw-r--r-- | stdout/stdout_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/stdout/stdout_test.go b/stdout/stdout_test.go index 6234854..e948070 100644 --- a/stdout/stdout_test.go +++ b/stdout/stdout_test.go @@ -72,6 +72,16 @@ func TestShowDevicesWithColor(t *testing.T) { assert.Contains(t, output.String(), "xxx") } +func TestShowDevicesWithErr(t *testing.T) { + output := bytes.NewBuffer(make([]byte, 10)) + + getter := device.LinuxDevicesInfoGetter{MountsPath: "/xyzxyz"} + ui := CreateStdoutUI(output, false, true, false) + err := ui.ListDevices(getter) + + assert.Contains(t, err.Error(), "no such file") +} + func printBuffer(buff *bytes.Buffer) { for i, x := range buff.String() { println(i, string(x)) |