From 81051d9e2d5fa34552eccf25801d137b5486c804 Mon Sep 17 00:00:00 2001 From: Garrett Squire Date: Thu, 27 Oct 2016 16:39:01 -0700 Subject: Enforce alphabetical ordering of packages in YAML config (#22) --- config_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'config_test.go') diff --git a/config_test.go b/config_test.go index 10422e9..3bbe7e9 100644 --- a/config_test.go +++ b/config_test.go @@ -27,3 +27,22 @@ packages: assert.Equal(t, pkg, Package{Repo: "github.com/grpc/grpc-go"}) } + +func TestNotAlphabetical(t *testing.T) { + path, clean := TempFile(t, ` + +url: google.golang.org +packages: + grpc: + repo: github.com/grpc/grpc-go + atomic: + repo: github.com/uber-go/atomic + +`) + defer clean() + + _, err := Parse(path) + if assert.Error(t, err, "YAML configuration is not listed alphabetically") { + assert.Contains(t, err.Error(), "must be alphabetically ordered") + } +} -- cgit v1.2.3