package config import ( "strings" "testing" ) func TestSwitchingLargeFilesOnRefusesToStart(t *testing.T) { cfg := Default() cfg.Paths.Repos, cfg.Paths.Cache, cfg.Paths.Artifacts = "/a", "/b", "/c" cfg.Behavior.AllowLFS = true err := cfg.check() if err == nil { t.Fatal("allow_lfs came on and the config passed, which is the trap it was") } if !strings.Contains(err.Error(), "not built") { t.Errorf("the error does not say why: %v", err) } cfg.Behavior.AllowLFS = false if err := cfg.check(); err != nil { t.Errorf("a config with large files off did not pass: %v", err) } }