diff options
author | 2016-10-27 16:39:01 -0700 | |
---|---|---|
committer | 2016-10-27 16:39:01 -0700 | |
commit | 81051d9e2d5fa34552eccf25801d137b5486c804 (patch) | |
tree | 58a529445f3eaa5d80cf2d6f0cc4428e57df0eb4 /config_test.go | |
parent | ac8374fd17e30fca9a7773a2a6f690a7ea4d2ec9 (diff) | |
download | sally-81051d9e2d5fa34552eccf25801d137b5486c804.tar.gz sally-81051d9e2d5fa34552eccf25801d137b5486c804.tar.zst sally-81051d9e2d5fa34552eccf25801d137b5486c804.zip |
Enforce alphabetical ordering of packages in YAML config (#22)
Diffstat (limited to 'config_test.go')
-rw-r--r-- | config_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
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") + } +} |