This commit is contained in:
@@ -204,7 +204,7 @@ func TestFormatMessage(t *testing.T) {
|
||||
func TestFromEnvDisabled(t *testing.T) {
|
||||
t.Setenv("DISCORD_BOT_TOKEN", "")
|
||||
t.Setenv("DISCORD_CHANNEL_ID", "")
|
||||
bot, err := FromEnv(newMemoryLinks(), nil)
|
||||
bot, err := FromEnv(newMemoryLinks(), nil, nil, nil)
|
||||
if err != nil || bot != nil {
|
||||
t.Fatalf("disabled FromEnv = (%v, %v)", bot, err)
|
||||
}
|
||||
@@ -213,12 +213,12 @@ func TestFromEnvDisabled(t *testing.T) {
|
||||
func TestFromEnvRequiresBoth(t *testing.T) {
|
||||
t.Setenv("DISCORD_BOT_TOKEN", "token")
|
||||
t.Setenv("DISCORD_CHANNEL_ID", "")
|
||||
if _, err := FromEnv(newMemoryLinks(), nil); err == nil {
|
||||
if _, err := FromEnv(newMemoryLinks(), nil, nil, nil); err == nil {
|
||||
t.Fatal("expected error when channel is missing")
|
||||
}
|
||||
t.Setenv("DISCORD_BOT_TOKEN", "")
|
||||
t.Setenv("DISCORD_CHANNEL_ID", "channel")
|
||||
if _, err := FromEnv(newMemoryLinks(), nil); err == nil {
|
||||
if _, err := FromEnv(newMemoryLinks(), nil, nil, nil); err == nil {
|
||||
t.Fatal("expected error when token is missing")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user