summaryrefslogtreecommitdiffstats
path: root/stdout
diff options
context:
space:
mode:
authorDaniel Milde <daniel@milde.cz>2021-02-13 22:43:28 +0100
committerDaniel Milde <daniel@milde.cz>2021-02-13 22:43:28 +0100
commit234b8fdd535846b7e0f525dca17863c18606fd43 (patch)
tree116511ba1c4cda291b3292c0b0f8875c4605a847 /stdout
parentf2cc515d40709a7a60da0dc94633476b204f319a (diff)
more tests
Diffstat (limited to 'stdout')
-rw-r--r--stdout/stdout_test.go10
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))