diff options
Diffstat (limited to 'internal/environment/flags_test.go')
| -rw-r--r-- | internal/environment/flags_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/environment/flags_test.go b/internal/environment/flags_test.go index 0cab282..2c2750d 100644 --- a/internal/environment/flags_test.go +++ b/internal/environment/flags_test.go @@ -122,6 +122,20 @@ func TestSetFlagsReturnsConfigErrors(t *testing.T) { } } +func TestValidateFlagsReturnsError(t *testing.T) { + env := defaultEnvironment() + env.DataDir = "data" + env.StaticDir = "web" + if err := env.validateFlags(); err != nil { + t.Fatal(err) + } + + env.StaticDir = "" + if err := env.validateFlags(); err == nil { + t.Fatal("Expected error") + } +} + func writeConfig(t *testing.T, name string, contents string) string { t.Helper() |
