1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

Update to version 8.5.0 | NEW: MVC Output Result | Read HISTORY.md

Former-commit-id: 6a3579f2500fc715d7dc606478960946dcade61d
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-10-09 15:26:46 +03:00
parent fda35cbdb5
commit 49ee8f2d75
40 changed files with 1959 additions and 191 deletions

View File

@@ -32,12 +32,18 @@ type Configuration struct {
// Debug if true then debug messages from the httpexpect will be shown when a test runs
// Defaults to false.
Debug bool
// LogLevel sets the application's log level.
// Defaults to "disable" when testing.
LogLevel string
}
// Set implements the OptionSetter for the Configuration itself
func (c Configuration) Set(main *Configuration) {
main.URL = c.URL
main.Debug = c.Debug
if c.LogLevel != "" {
main.LogLevel = c.LogLevel
}
}
var (
@@ -55,11 +61,19 @@ var (
c.Debug = val
}
}
// LogLevel sets the application's log level "val".
// Defaults to disabled when testing.
LogLevel = func(val string) OptionSet {
return func(c *Configuration) {
c.LogLevel = val
}
}
)
// DefaultConfiguration returns the default configuration for the httptest.
func DefaultConfiguration() *Configuration {
return &Configuration{URL: "", Debug: false}
return &Configuration{URL: "", Debug: false, LogLevel: "disable"}
}
// New Prepares and returns a new test framework based on the "app".
@@ -71,7 +85,7 @@ func New(t *testing.T, app *iris.Application, setters ...OptionSetter) *httpexpe
}
// disable the logger
app.Logger().SetLevel("disable")
app.Logger().SetLevel(conf.LogLevel)
app.Build()
testConfiguration := httpexpect.Config{