fork/gdu

git clone https://git.julia.blue/fork/gdu

Daniel Mildeci: use golangci-lint 2.6 (#449)8b8f1e9

ignore
528 B21 linesraw
1//go:build freebsd || openbsd || netbsd || darwin
2
3package device
4
5import (
6	"testing"
7
8	"github.com/stretchr/testify/assert"
9)
10
11func TestGetDevicesInfo(t *testing.T) {
12	getter := BSDDevicesInfoGetter{MountCmd: "/sbin/mount"}
13	devices, _ := getter.GetDevicesInfo()
14	assert.IsType(t, Devices{}, devices)
15}
16
17func TestGetDevicesInfoFail(t *testing.T) {
18	getter := BSDDevicesInfoGetter{MountCmd: "/nonexistent"}
19	_, err := getter.GetDevicesInfo()
20	assert.Equal(t, "fork/exec /nonexistent: no such file or directory", err.Error())
21}