1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 20:07:04 +00:00

able to share static configuration between multiple server instances based on the homepath+iris.yml file with iris.WithGlobalConfiguration configurator

Former-commit-id: 3e528a3d01eb36b4c0781149e52acffd4dc5cf9f
This commit is contained in:
kataras
2017-11-07 01:40:56 +02:00
parent af9a1f1241
commit 7723e438a1
13 changed files with 216 additions and 30 deletions

View File

@@ -89,6 +89,19 @@ func TestConfigurationOptionsDeep(t *testing.T) {
t.Fatalf("DEEP configuration is not the same after New expected:\n %#v \ngot:\n %#v", expected, has)
}
}
func TestConfigurationGlobal(t *testing.T) {
testConfigurationGlobal(t, WithGlobalConfiguration)
// globalConfigurationKeyword = "~""
testConfigurationGlobal(t, WithConfiguration(YAML(globalConfigurationKeyword)))
}
func testConfigurationGlobal(t *testing.T, c Configurator) {
app := New().Configure(c)
if has, expected := *app.config, DefaultConfiguration(); !reflect.DeepEqual(has, expected) {
t.Fatalf("global configuration (which should be defaulted) is not the same with the default one:\n %#v \ngot:\n %#v", has, expected)
}
}
func TestConfigurationYAML(t *testing.T) {
yamlFile, ferr := ioutil.TempFile("", "configuration.yml")