mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-01 21:24:23 +08:00
20 lines
433 B
Go
20 lines
433 B
Go
|
package caddy
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"strings"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestAssetsPath(t *testing.T) {
|
||
|
if actual := AssetsPath(); !strings.HasSuffix(actual, ".caddy") {
|
||
|
t.Errorf("Expected path to be a .caddy folder, got: %v", actual)
|
||
|
}
|
||
|
|
||
|
os.Setenv("CADDYPATH", "testpath")
|
||
|
if actual, expected := AssetsPath(), "testpath"; actual != expected {
|
||
|
t.Errorf("Expected path to be %v, got: %v", expected, actual)
|
||
|
}
|
||
|
os.Setenv("CADDYPATH", "")
|
||
|
}
|