diff options
Diffstat (limited to 'pkg/config/config_test.go')
-rw-r--r-- | pkg/config/config_test.go | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 9080351..cc58ce9 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -18,9 +18,11 @@ func TestFileParsing(t *testing.T) { name: "minimal scan", config: `scan "/srv/git"`, expectedConfig: &configuration{ - Scan: &scan{ - Public: false, - Path: "/srv/git", + Scans: []*scan{ + { + Public: false, + Path: "/srv/git", + }, }, ListenAddr: defaultAddr(), Repositories: []*GitRepositoryConfiguration{}, @@ -33,9 +35,11 @@ scan "/srv/git" { public true }`, expectedConfig: &configuration{ - Scan: &scan{ - Public: true, - Path: "/srv/git", + Scans: []*scan{ + { + Public: true, + Path: "/srv/git", + }, }, ListenAddr: defaultAddr(), Repositories: []*GitRepositoryConfiguration{}, @@ -45,7 +49,7 @@ scan "/srv/git" { name: "minimal repository", config: `repository /srv/git/cerrado.git`, expectedConfig: &configuration{ - Scan: defaultScan(), + Scans: defaultScans(), ListenAddr: defaultAddr(), Repositories: []*GitRepositoryConfiguration{ { @@ -68,7 +72,7 @@ repository /srv/git/cerrado.git { about readme.txt }`, expectedConfig: &configuration{ - Scan: defaultScan(), + Scans: defaultScans(), ListenAddr: defaultAddr(), Repositories: []*GitRepositoryConfiguration{ { @@ -85,7 +89,7 @@ repository /srv/git/cerrado.git { name: "minimal listen", config: ``, expectedConfig: &configuration{ - Scan: defaultScan(), + Scans: defaultScans(), ListenAddr: defaultAddr(), Repositories: []*GitRepositoryConfiguration{}, }, @@ -94,7 +98,7 @@ repository /srv/git/cerrado.git { name: "complete listen", config: `listen-addr unix://var/run/cerrado/cerrado.sock`, expectedConfig: &configuration{ - Scan: defaultScan(), + Scans: defaultScans(), ListenAddr: "unix://var/run/cerrado/cerrado.sock", Repositories: []*GitRepositoryConfiguration{}, }, @@ -120,9 +124,11 @@ repository /srv/git/cerrado.git { about readme.txt }`, expectedConfig: &configuration{ - Scan: &scan{ - Public: true, - Path: "/srv/git", + Scans: []*scan{ + { + Public: true, + Path: "/srv/git", + }, }, ListenAddr: "unix://var/run/cerrado/cerrado.sock", Passphrase: "$2a$14$VnB/ZcB1DUDkMnosRA6Y7.dj8h5eroslDxTeXlLwfQX/x86mh6WAq", |