refractor: rename some path util function.
This commit is contained in:
parent
ebdeef152c
commit
982c2c66aa
13 changed files with 87 additions and 82 deletions
|
|
@ -10,7 +10,6 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/roddhjav/apparmor.d/pkg/paths"
|
||||
"github.com/roddhjav/apparmor.d/pkg/util"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -21,7 +20,7 @@ var (
|
|||
// mustReadProfileFile read a file and return its content as a slice of string.
|
||||
// It panics if an error occurs. It removes the last comment line.
|
||||
func mustReadProfileFile(path *paths.Path) string {
|
||||
res := strings.Split(util.MustReadFile(path), "\n")
|
||||
res := strings.Split(path.MustReadFileAsString(), "\n")
|
||||
return strings.Join(res[:len(res)-2], "\n")
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +107,7 @@ func TestAppArmorProfileFile_String(t *testing.T) {
|
|||
},
|
||||
}},
|
||||
},
|
||||
want: util.MustReadFile(testData.Join("string.aa")),
|
||||
want: testData.Join("string.aa").MustReadFileAsString(),
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue