Commit 2e512e81 authored by Brian Tiger Chow's avatar Brian Tiger Chow

test(config) add path assertion

parent a5c0f67c
package config package config
import ( import (
"fmt"
"testing" "testing"
) )
func TestConfig(t *testing.T) { func TestConfig(t *testing.T) {
const filename = ".ipfsconfig" const filename = ".ipfsconfig"
const dsPath = "/path/to/datastore"
cfgWritten := new(Config) cfgWritten := new(Config)
cfgWritten.Datastore.Path = dsPath
err := WriteConfigFile(filename, cfgWritten) err := WriteConfigFile(filename, cfgWritten)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
...@@ -17,6 +18,7 @@ func TestConfig(t *testing.T) { ...@@ -17,6 +18,7 @@ func TestConfig(t *testing.T) {
t.Error(err) t.Error(err)
return return
} }
if cfgWritten.Datastore.Path != cfgRead.Datastore.Path {
fmt.Printf(cfgRead.Datastore.Path) t.Fail()
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment