-
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ktr
authored
Feb 17, 2018
1 parent
e33da1a
commit ded70da
Showing
3 changed files
with
48 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package config | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestConfig_Get(t *testing.T) { | ||
checkValues := func() { | ||
c := Get() | ||
_ = c.REPL.Server.Host | ||
_ = c.Env.Server.Host | ||
} | ||
|
||
t.Run("no local config", func(t *testing.T) { | ||
checkValues() | ||
}) | ||
|
||
t.Run("has local config", func(t *testing.T) { | ||
f, err := ioutil.TempFile("", "") | ||
require.NoError(t, err) | ||
defer f.Close() | ||
|
||
backup := localConfigName | ||
defer func() { | ||
localConfigName = backup | ||
}() | ||
|
||
localConfigName = f.Name() | ||
|
||
checkValues() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ package meta | |
|
||
const ( | ||
Name = "evans" | ||
Version = "0.2.6" | ||
Version = "0.2.7" | ||
) |