Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 6e92bbb

Browse files
author
Gregor Noczinski
committed
Adjust tests to run with Caddy 0.10.10
1 parent 176e190 commit 6e92bbb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ golang {
1212
// For testing only the current platform is required.
1313
platforms = currentPlatform()
1414
dependencies {
15-
build 'github.com/mholt/caddy:v0.10.4'
15+
build 'github.com/mholt/caddy:v0.10.10'
1616
test 'github.com/stretchr/testify'
1717
tool 'github.com/mattn/goveralls'
1818
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip

init_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (s *initTest) Test_parseConfiguration_withPathAndContentTypeCombination(c *
6161
controller = s.newControllerFor("filter rule {\npath_content_type_combination foo\npath myPath\ncontent_type myContentType\nsearch_pattern mySearchPattern\n}\n")
6262
err = setup(controller)
6363
c.Assert(err, NotNil)
64-
c.Assert(err.Error(), Equals, "Testfile:2 - Parse error: Illegal value for 'path_content_type_combination': foo")
64+
c.Assert(err.Error(), Equals, "Testfile:2 - Error during parsing: Illegal value for 'path_content_type_combination': foo")
6565
}
6666

6767
func (s *initTest) Test_parseConfiguration_directNamed(c *C) {
@@ -112,7 +112,7 @@ func (s *initTest) Test_evalSimpleOption(c *C) {
112112
c.Error("This method should not be called.")
113113
return nil
114114
})
115-
c.Assert(err, DeepEquals, errors.New("Testfile:1 - Parse error: Wrong argument count or unexpected line ending after 'start'"))
115+
c.Assert(err, DeepEquals, errors.New("Testfile:1 - Error during parsing: Wrong argument count or unexpected line ending after 'start'"))
116116
}
117117

118118
func (s *initTest) Test_evalRegexpOption(c *C) {
@@ -169,16 +169,16 @@ func (s *initTest) Test_evalRule(c *C) {
169169
c.Assert(string(r.replacement), Equals, "myReplacement")
170170

171171
err = evalRule(s.newControllerFor("{\nfoo bar\n}\n"), []string{}, handler)
172-
c.Assert(err, DeepEquals, errors.New("Testfile:2 - Parse error: Unknown option: foo"))
172+
c.Assert(err, DeepEquals, errors.New("Testfile:2 - Error during parsing: Unknown option: foo"))
173173

174174
err = evalRule(s.newControllerFor("{\n}\n"), []string{}, handler)
175-
c.Assert(err, DeepEquals, errors.New("Testfile:2 - Parse error: Neither 'path' nor 'content_type' definition was provided for filter rule block."))
175+
c.Assert(err, DeepEquals, errors.New("Testfile:2 - Error during parsing: Neither 'path' nor 'content_type' definition was provided for filter rule block."))
176176

177177
err = evalRule(s.newControllerFor("{\npath myPath\n}\n"), []string{}, handler)
178-
c.Assert(err, DeepEquals, errors.New("Testfile:3 - Parse error: No 'search_pattern' definition was provided for filter rule block."))
178+
c.Assert(err, DeepEquals, errors.New("Testfile:3 - Error during parsing: No 'search_pattern' definition was provided for filter rule block."))
179179

180180
err = evalRule(s.newControllerFor(""), []string{"foo"}, handler)
181-
c.Assert(err, DeepEquals, errors.New("Testfile:1 - Parse error: No more arguments for filter block 'rule' supported."))
181+
c.Assert(err, DeepEquals, errors.New("Testfile:1 - Error during parsing: No more arguments for filter block 'rule' supported."))
182182
}
183183

184184
func (s *initTest) Test_evalMaximumBufferSize(c *C) {
@@ -188,10 +188,10 @@ func (s *initTest) Test_evalMaximumBufferSize(c *C) {
188188
c.Assert(handler.maximumBufferSize, Equals, 123)
189189

190190
err = evalMaximumBufferSize(s.newControllerFor(""), []string{}, handler)
191-
c.Assert(err, DeepEquals, errors.New("Testfile:1 - Parse error: There are exact one argument for filter directive 'max_buffer_size' expected."))
191+
c.Assert(err, DeepEquals, errors.New("Testfile:1 - Error during parsing: There are exact one argument for filter directive 'max_buffer_size' expected."))
192192

193193
err = evalMaximumBufferSize(s.newControllerFor(""), []string{"abc"}, handler)
194-
c.Assert(err, ErrorMatches, "Testfile:1 - Parse error: There is no valid value for filter directive 'max_buffer_size' provided. Got: strconv.(ParseInt|Atoi): parsing \"abc\": invalid syntax")
194+
c.Assert(err, ErrorMatches, "Testfile:1 - Error during parsing: There is no valid value for filter directive 'max_buffer_size' provided. Got: strconv.(ParseInt|Atoi): parsing \"abc\": invalid syntax")
195195
}
196196

197197
func (s *initTest) newControllerFor(plainTokens string) *caddy.Controller {

0 commit comments

Comments
 (0)