Skip to content

Commit

Permalink
Formatting available commands list
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemeng Qin committed Oct 31, 2018
1 parent 16f11e9 commit 11dcf7e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions whosinbot/whos_in_bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ func (b *WhosInBot) handleAvailableCommands(command domain.Command) (*domain.Res
}

func formatAvailableCommands(allCommands []string) string {
formatted := ""
formatted := "Available commands:\n"
for _, command := range allCommands {
formatted += fmt.Sprintf("%s\n", command)
formatted += fmt.Sprintf(" 🍺 %s\n", command)
}
return formatted
}
Expand Down
25 changes: 13 additions & 12 deletions whosinbot/whos_in_bot_ginkgo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ var _ = Describe("WhosInBot", func() {
},
}

formattedAvailableCommands := fmt.Sprint("start_roll_call\n" +
"end_roll_call\n" +
"set_title\n" +
"in\n" +
"out\n" +
"maybe\n" +
"set_in_for\n" +
"set_out_for\n" +
"set_maybe_for\n" +
"whos_in\n" +
"shh\n" +
"louder\n")
formattedAvailableCommands := fmt.Sprint("Available commands:\n" +
" 🍺 start_roll_call\n" +
" 🍺 end_roll_call\n" +
" 🍺 set_title\n" +
" 🍺 in\n" +
" 🍺 out\n" +
" 🍺 maybe\n" +
" 🍺 set_in_for\n" +
" 🍺 set_out_for\n" +
" 🍺 set_maybe_for\n" +
" 🍺 whos_in\n" +
" 🍺 shh\n" +
" 🍺 louder\n")
expectedResponse := &domain.Response{ChatID: command.ChatID,
Text: formattedAvailableCommands}

Expand Down

0 comments on commit 11dcf7e

Please sign in to comment.