ipld-eth-server/pkg/config/config_test.go
Matt Krump 06f78e0083 Handle events
- Adds interfaces for developers to build handlers that update data in
response to log events
- Resolves #29
2018-03-05 10:01:50 -06:00

25 lines
787 B
Go

package config_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/spf13/viper"
)
var _ = Describe("Loading the config", func() {
It("reads the private config using the environment", func() {
testConfig := viper.New()
testConfig.SetConfigName("private")
testConfig.AddConfigPath("$GOPATH/src/github.com/vulcanize/vulcanizedb/environments/")
err := testConfig.ReadInConfig()
Expect(viper.Get("client.ipcpath")).To(BeNil())
Expect(err).To(BeNil())
Expect(testConfig.Get("database.hostname")).To(Equal("localhost"))
Expect(testConfig.Get("database.name")).To(Equal("vulcanize_private"))
Expect(testConfig.Get("database.port")).To(Equal(int64(5432)))
Expect(testConfig.Get("client.ipcpath")).To(Equal("test_data_dir/geth.ipc"))
})
})