influxdb/services/meta/config_test.go

27 lines
504 B
Go
Raw Normal View History

2015-12-23 15:48:25 +00:00
package meta_test
import (
"testing"
"github.com/BurntSushi/toml"
"github.com/influxdata/influxdb/services/meta"
2015-12-23 15:48:25 +00:00
)
func TestConfig_Parse(t *testing.T) {
// Parse configuration.
var c meta.Config
if _, err := toml.Decode(`
dir = "/tmp/foo"
logging-enabled = false
`, &c); err != nil {
t.Fatal(err)
}
// Validate configuration.
if c.Dir != "/tmp/foo" {
2015-12-23 15:48:25 +00:00
t.Fatalf("unexpected dir: %s", c.Dir)
} else if c.LoggingEnabled {
t.Fatalf("unexpected logging enabled: %v", c.LoggingEnabled)
}
}