mirror of
https://github.com/spf13/viper
synced 2025-05-07 04:37:20 +00:00
add test for unregister alias
This commit is contained in:
parent
3421df1f9b
commit
e270d7d00f
1 changed files with 7 additions and 0 deletions
|
@ -322,6 +322,13 @@ func TestAliasInConfigFile(t *testing.T) {
|
|||
assert.Equal(t, false, Get("beard"))
|
||||
}
|
||||
|
||||
func TestUnSetAliases(t *testing.T) {
|
||||
RegisterAlias("years", "age")
|
||||
assert.Equal(t, 40, Get("years"))
|
||||
UnregisterAlias("years")
|
||||
assert.Equal(t, nil, Get("years"))
|
||||
}
|
||||
|
||||
func TestYML(t *testing.T) {
|
||||
initYAML()
|
||||
assert.Equal(t, "steve", Get("name"))
|
||||
|
|
Loading…
Add table
Reference in a new issue