Retrieve parent keys accessible from a child section (#52)

Retrieve parent keys available to a child section
This commit is contained in:
AT1012
2016-06-01 12:00:29 -07:00
committed by Unknwon
parent 12f418cc7e
commit d291594290
2 changed files with 27 additions and 0 deletions
+7
View File
@@ -59,6 +59,13 @@ func Test_Key(t *testing.T) {
}
})
Convey("Get parent-keys that are available to the child section", func() {
parentKeys := cfg.Section("package.sub").ParentKeys()
for _, k := range parentKeys {
So(k.Name(), ShouldEqual, "CLONE_URL")
}
})
Convey("Get overwrite value", func() {
So(cfg.Section("author").Key("E-MAIL").String(), ShouldEqual, "u@gogs.io")
})