From 2dd4cf35aab8324608a83d337459fd8354521b92 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Mon, 27 May 2024 22:36:50 +0200 Subject: feat: Wraps handler into its own package Although this creates more complex folder structure will allow in the feature for a easier testing of those given handlers. --- pkg/config/config_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pkg/config/config_test.go') diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index c8cd887..7afbaef 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -8,17 +8,17 @@ import ( "github.com/google/go-cmp/cmp" ) -func TestConfig(t *testing.T) { +func TestFileParsing(t *testing.T) { testCases := []struct { name string config string - expectedConfig *Configuration + expectedConfig *configuration }{ { name: "minimal scan", config: `scan "/srv/git"`, - expectedConfig: &Configuration{ - Scan: &Scan{ + expectedConfig: &configuration{ + Scan: &scan{ Public: true, Path: "/srv/git", }, @@ -29,8 +29,8 @@ func TestConfig(t *testing.T) { config: `scan "/srv/git" { public false }`, - expectedConfig: &Configuration{ - Scan: &Scan{ + expectedConfig: &configuration{ + Scan: &scan{ Public: false, Path: "/srv/git", }, @@ -41,7 +41,7 @@ func TestConfig(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { r := strings.NewReader(tc.config) - config, err := Parse(r) + config, err := parse(r) if err != nil { t.Fatalf("Error parsing config %s", err.Error()) } -- cgit v1.2.3