Files
cunicu/pkg/config/meta_test.go
T
Steffen Vogel ee0e60df68 make project reuse compliant
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-05-26 23:25:41 +02:00

40 lines
761 B
Go

// SPDX-FileCopyrightText: 2023 Steffen Vogel <post@steffenvogel.de>
// SPDX-License-Identifier: Apache-2.0
package config_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/stv0g/cunicu/pkg/config"
)
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"))
})
})