26 lines
561 B
Go
26 lines
561 B
Go
//go:build linux
|
|
// +build linux
|
|
|
|
package tui
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"b612.me/apps/b612/gdu/internal/testapp"
|
|
"b612.me/apps/b612/gdu/pkg/device"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestShowDevicesWithError(t *testing.T) {
|
|
app, simScreen := testapp.CreateTestAppWithSimScreen(50, 50)
|
|
defer simScreen.Fini()
|
|
|
|
getter := device.LinuxDevicesInfoGetter{MountsPath: "/xyzxyz"}
|
|
|
|
ui := CreateUI(app, simScreen, &bytes.Buffer{}, false, false, false, false, false)
|
|
err := ui.ListDevices(getter)
|
|
|
|
assert.Contains(t, err.Error(), "no such file")
|
|
}
|