mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 17:24:20 -04:00
middleware/chaos: fix version (#669)
* middleware/chaos: fix version Move the version setting into a init function so it is done early. Then tweak the setup code for chaos a bit to correctly pick this version up. Add an integration test to pick this up in the toplevel test/ directory. Fixes #667 * Update tests
This commit is contained in:
committed by
John Belamaric
parent
7e6f5c77aa
commit
024f56682d
@@ -1,7 +1,6 @@
|
||||
package chaos
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -17,20 +16,12 @@ func TestSetupChaos(t *testing.T) {
|
||||
expectedErrContent string // substring from the expected error. Empty for positive cases.
|
||||
}{
|
||||
// positive
|
||||
{
|
||||
`chaos`, false, defaultVersion, "", "",
|
||||
},
|
||||
{
|
||||
`chaos v2`, false, "v2", "", "",
|
||||
},
|
||||
{
|
||||
`chaos v3 "Miek Gieben"`, false, "v3", "Miek Gieben", "",
|
||||
},
|
||||
{
|
||||
fmt.Sprintf(`chaos {
|
||||
%s
|
||||
}`, defaultVersion), false, defaultVersion, "", "",
|
||||
},
|
||||
}
|
||||
|
||||
for i, test := range tests {
|
||||
|
||||
Reference in New Issue
Block a user