aboutsummaryrefslogtreecommitdiff
path: root/config_test.go
diff options
context:
space:
mode:
authorGravatar Jan-Philipp Benecke <github@bnck.me> 2021-05-19 00:49:33 +0200
committerGravatar GitHub <noreply@github.com> 2021-05-18 15:49:33 -0700
commit4f8f13fd76f065e49efdb3aa1a7504ffcafbf9a8 (patch)
treef68612e4882f707840ef0a1bc0d14477dfcb1c06 /config_test.go
parentb627e361379b89802df4930abbc64ce26bd8f323 (diff)
downloadsally-4f8f13fd76f065e49efdb3aa1a7504ffcafbf9a8.tar.gz
sally-4f8f13fd76f065e49efdb3aa1a7504ffcafbf9a8.tar.zst
sally-4f8f13fd76f065e49efdb3aa1a7504ffcafbf9a8.zip
Allow setting branch (#46)
Support specifying the branch from which source will be served in the YAML configuration.
Diffstat (limited to 'config_test.go')
-rw-r--r--config_test.go24
1 files changed, 22 insertions, 2 deletions
diff --git a/config_test.go b/config_test.go
index bf64085..e87954b 100644
--- a/config_test.go
+++ b/config_test.go
@@ -15,6 +15,7 @@ url: google.golang.org
packages:
grpc:
repo: github.com/grpc/grpc-go
+ branch: main
`)
defer clean()
@@ -28,7 +29,26 @@ packages:
pkg, ok := config.Packages["grpc"]
assert.True(t, ok)
- assert.Equal(t, pkg, Package{Repo: "github.com/grpc/grpc-go"})
+ assert.Equal(t, pkg, Package{Repo: "github.com/grpc/grpc-go", Branch: "main"})
+}
+
+func TestParseDefaultBranch(t *testing.T) {
+ path, clean := TempFile(t, `
+
+url: google.golang.org
+packages:
+ grpc:
+ repo: github.com/grpc/grpc-go
+
+`)
+ defer clean()
+
+ config, err := Parse(path)
+ assert.NoError(t, err)
+
+ pkg, ok := config.Packages["grpc"]
+ assert.True(t, ok)
+ assert.Equal(t, pkg, Package{Repo: "github.com/grpc/grpc-go", Branch: "master"})
}
func TestParseGodocServer(t *testing.T) {
@@ -62,7 +82,7 @@ packages:
pkg, ok := config.Packages["grpc"]
assert.True(t, ok)
- assert.Equal(t, Package{Repo: "github.com/grpc/grpc-go"}, pkg)
+ assert.Equal(t, Package{Repo: "github.com/grpc/grpc-go", Branch: "master"}, pkg)
})
}
}