133728e barerepo 1mo
1
package config
133728e barerepo 1mo
3
import (
133728e barerepo 1mo
4
"strings"
133728e barerepo 1mo
5
"testing"
133728e barerepo 1mo
8
func TestSwitchingLargeFilesOnRefusesToStart(t *testing.T) {
133728e barerepo 1mo
9
cfg := Default()
133728e barerepo 1mo
10
cfg.Paths.Repos, cfg.Paths.Cache, cfg.Paths.Artifacts = "/a", "/b", "/c"
133728e barerepo 1mo
11
cfg.Behavior.AllowLFS = true
133728e barerepo 1mo
12
err := cfg.check()
133728e barerepo 1mo
13
if err == nil {
133728e barerepo 1mo
14
t.Fatal("allow_lfs came on and the config passed, which is the trap it was")
133728e barerepo 1mo
16
if !strings.Contains(err.Error(), "not built") {
133728e barerepo 1mo
17
t.Errorf("the error does not say why: %v", err)
133728e barerepo 1mo
19
cfg.Behavior.AllowLFS = false
133728e barerepo 1mo
20
if err := cfg.check(); err != nil {
133728e barerepo 1mo
21
t.Errorf("a config with large files off did not pass: %v", err)