Skip to content

Commit 16bbc12

Browse files
committed
Merge pull request #128 from ccnp123/master
Make file paths in config_test OS agnostic
2 parents 9c0f385 + f915ef4 commit 16bbc12

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

config/config_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestDefaultValues(t *testing.T) {
1616
c.configure()
1717
assert.Equal(t, "", c.APIKey)
1818
assert.Equal(t, "http://exercism.io", c.API)
19-
assert.Equal(t, "/home/alice/exercism", c.Dir)
19+
assert.Equal(t, filepath.FromSlash("/home/alice/exercism"), c.Dir)
2020
}
2121

2222
func TestCustomValues(t *testing.T) {
@@ -55,7 +55,7 @@ func TestFilePath(t *testing.T) {
5555
c := &Config{}
5656
c.home = "/home/alice"
5757
c.configure()
58-
assert.Equal(t, "/home/alice/.exercism.json", c.File())
58+
assert.Equal(t, filepath.FromSlash("/home/alice/.exercism.json"), c.File())
5959

6060
// can override location of config file
6161
c = &Config{}
@@ -70,7 +70,7 @@ func TestReadNonexistantConfig(t *testing.T) {
7070
assert.Equal(t, c.APIKey, "")
7171
assert.Equal(t, c.API, "http://exercism.io")
7272
assert.False(t, c.IsAuthenticated())
73-
if !strings.HasSuffix(c.Dir, "/exercism") {
73+
if !strings.HasSuffix(c.Dir, filepath.FromSlash("/exercism") ) {
7474
t.Fatal("Default unconfigured config should use home dir")
7575
}
7676
}

0 commit comments

Comments
 (0)