1
0
mirror of https://github.com/go-task/task.git synced 2025-03-21 21:27:07 +02:00

refactoring

This commit is contained in:
jaedle 2019-02-24 17:25:03 +01:00
parent c82a7240bb
commit 5cfd9bbbbd
2 changed files with 18 additions and 14 deletions

View File

@ -24,7 +24,8 @@ func printTaskCommands(cmds []*taskfile.Cmd, logger *logger.Logger) {
logger.Outf("")
logger.Outf("commands:")
for _, c := range cmds {
if c.Cmd != "" {
isCommand := c.Cmd != ""
if isCommand {
logger.Outf(" - %s", c.Cmd)
} else {
logger.Outf(" - Task: %s", c.Task)

View File

@ -123,19 +123,22 @@ func TestFullSummary(t *testing.T) {
summary.Print(&l, task)
assert.Equal(t, expectedOutput(), buffer.String())
}
func expectedOutput() string {
expected :=
`task: sample-task
line1
line2
line3
dependencies:
- dependency
commands:
- command
`
assert.Equal(t, expected, buffer.String())
line1
line2
line3
dependencies:
- dependency
commands:
- command
`
return expected
}