Files
cunicu/pkg/config/meta_test.go
Steffen Vogel 3bee839348 fix: Update copyright years
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2025-01-01 22:45:39 +01:00

41 lines
760 B
Go

// SPDX-FileCopyrightText: 2023-2025 Steffen Vogel <post@steffenvogel.de>
// SPDX-License-Identifier: Apache-2.0
package config_test
import (
"cunicu.li/cunicu/pkg/config"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Context("meta", func() {
var m *config.Meta
BeforeEach(func() {
m = config.Metadata()
Expect(m).NotTo(BeNil())
})
It("can enumerate all keys", func() {
m := config.Metadata()
keys := m.Keys()
Expect(keys).To(ContainElements(
Equal("sync_hosts"),
Equal("watch_interval"),
Equal("ice.disconnected_timeout"),
))
Expect(keys).NotTo(ContainElements(
"ice",
))
})
It("can lookup a key", func() {
n := m.Lookup("ice")
Expect(n.Fields).To(HaveKey("disconnected_timeout"))
})
})