mirror of
https://github.com/go-task/task.git
synced 2025-01-06 03:53:54 +02:00
refactoring
This commit is contained in:
parent
b2edbf05a1
commit
8dd87dc482
11
task_test.go
11
task_test.go
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user