Skip to content

Commit

Permalink
swap test to viper
Browse files Browse the repository at this point in the history
  • Loading branch information
bitspill committed Dec 11, 2018
1 parent 8509f95 commit f5ec0ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ package config

import (
"testing"

"github.com/spf13/viper"
)

func TestSetTestnet(t *testing.T) {
// save pre test value
testnet := IsTestnet()

SetTestnet(true)
if Get("testnet").Bool(false) != true {
if viper.GetBool("testnet") != true {
t.Error("expected true, received false")
}

SetTestnet(false)
if Get("testnet").Bool(true) != false {
if viper.GetBool("testnet") != false {
t.Error("expected false, received true")
}

Expand Down

0 comments on commit f5ec0ac

Please sign in to comment.