mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 11:57:02 +00:00
Update to 7.2.0. Read https://github.com/kataras/iris/blob/master/HISTORY.md#th-15-june-2017--v720
Fix https://github.com/iris-contrib/community-board/issues/12 . Read more: https://github.com/kataras/iris/blob/master/HISTORY.md#th-15-june-2017--v720 Former-commit-id: 398cb69fdc7e5367b147693371287ffb7b912feb
This commit is contained in:
@@ -66,16 +66,9 @@ func DefaultConfiguration() *Configuration {
|
||||
return &Configuration{URL: "", Debug: false}
|
||||
}
|
||||
|
||||
// New Prepares and returns a new test framework based on the app
|
||||
// is useful when you need to have more than one test framework for the same iris instance
|
||||
// usage:
|
||||
// iris.Default.Get("/mypath", func(ctx context.Context){ctx.Write("my body")})
|
||||
// ...
|
||||
// e := httptest.New(iris.Default, t)
|
||||
// e.GET("/mypath").Expect().Status(iris.StatusOK).Body().Equal("my body")
|
||||
//
|
||||
// You can find example on the https://github.com/kataras/iris/glob/master/context_test.go
|
||||
func New(app *iris.Application, t *testing.T, setters ...OptionSetter) *httpexpect.Expect {
|
||||
// New Prepares and returns a new test framework based on the "app".
|
||||
// You can find example on the https://github.com/kataras/iris/tree/master/_examples/intermediate/httptest
|
||||
func New(t *testing.T, app *iris.Application, setters ...OptionSetter) *httpexpect.Expect {
|
||||
conf := DefaultConfiguration()
|
||||
for _, setter := range setters {
|
||||
setter.Set(conf)
|
||||
@@ -103,7 +96,8 @@ func New(app *iris.Application, t *testing.T, setters ...OptionSetter) *httpexpe
|
||||
return httpexpect.WithConfig(testConfiguration)
|
||||
}
|
||||
|
||||
// NewInsecure same as New but receives a single host instead of the whole framework
|
||||
// NewInsecure same as New but receives a single host instead of the whole framework.
|
||||
// Useful for testing running TLS servers.
|
||||
func NewInsecure(t *testing.T, setters ...OptionSetter) *httpexpect.Expect {
|
||||
conf := DefaultConfiguration()
|
||||
for _, setter := range setters {
|
||||
|
||||
Reference in New Issue
Block a user