@cryptotaxi247 / kubo / commits / 2e512e81c

test(config) add path assertion

Brian Tiger Chow committed Sep 12, 2014 at 04:36 UTC 2e512e81c92b44ba6a4a86b36b9de8dd35f7dc53
1 file changed +5 -3
config/config_test.go
+5 -3
@@ -1,13 +1,14 @@
1 package config
2
3 import (
4 - "fmt"
4 "testing"
5 )
6
7 func TestConfig(t *testing.T) {
8 const filename = ".ipfsconfig"
9 + const dsPath = "/path/to/datastore"
10 cfgWritten := new(Config)
11 + cfgWritten.Datastore.Path = dsPath
12 err := WriteConfigFile(filename, cfgWritten)
13 if err != nil {
14 t.Error(err)
@@ -17,6 +18,7 @@ func TestConfig(t *testing.T) {
18 t.Error(err)
19 return
20 }
20 -
21 - fmt.Printf(cfgRead.Datastore.Path)
21 + if cfgWritten.Datastore.Path != cfgRead.Datastore.Path {
22 + t.Fail()
23 + }
24 }