1
0
mirror of https://github.com/go-task/task.git synced 2025-01-06 03:53:54 +02:00

refactoring

This commit is contained in:
jaedle 2019-02-24 14:23:44 +01:00
parent b2edbf05a1
commit 8dd87dc482

View File

@ -579,11 +579,8 @@ func TestDetails(t *testing.T) {
Silent: true,
}
assert.NoError(t, e.Setup())
exp := readTestFixture(t, dir, "expected-task-with-details-details.txt")
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: "task-with-details"}))
assert.Equal(t, string(exp), buff.String())
assert.Equal(t, readTestFixture(t, dir, "expected-task-with-details-details.txt"), buff.String())
buff.Reset()
const noDetails = "task-without-details"
@ -603,8 +600,8 @@ func TestDetails(t *testing.T) {
}
func readTestFixture(t *testing.T, dir string, file string) []byte {
exp, err := ioutil.ReadFile(dir + "/" + file)
func readTestFixture(t *testing.T, dir string, file string) string {
b, err := ioutil.ReadFile(dir + "/" + file)
assert.NoError(t, err, "error reading text fixture")
return exp
return string(b)
}