4ba781d74f
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
23 lines
404 B
Go
23 lines
404 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestGetConfigLocationWithDefault(t *testing.T) {
|
|
assert.Equal(t, "config", getConfigLocation())
|
|
}
|
|
|
|
func TestGetConfigLocationWithEnvironmentOverride(t *testing.T) {
|
|
os.Setenv("PRBOT_CONFIG_PATH", "/tmp/")
|
|
|
|
assert.Equal(t, "/tmp/", getConfigLocation())
|
|
|
|
t.Cleanup(func() {
|
|
os.Unsetenv("PRBOT_CONFIG_PATH")
|
|
})
|
|
}
|