diff --git a/workspace/exercise_test.go b/workspace/exercise_test.go index ae4776424..4bd2abb1b 100644 --- a/workspace/exercise_test.go +++ b/workspace/exercise_test.go @@ -17,9 +17,9 @@ func TestHasMetadata(t *testing.T) { exerciseA := Exercise{Root: ws, Track: "bogus-track", Slug: "apple"} exerciseB := Exercise{Root: ws, Track: "bogus-track", Slug: "banana"} - err = os.MkdirAll(filepath.Join(exerciseA.Filepath(), ignoreSubdir), os.FileMode(0755)) + err = os.MkdirAll(filepath.Dir(exerciseA.MetadataFilepath()), os.FileMode(0755)) assert.NoError(t, err) - err = os.MkdirAll(filepath.Join(exerciseB.Filepath(), ignoreSubdir), os.FileMode(0755)) + err = os.MkdirAll(filepath.Dir(exerciseB.MetadataFilepath()), os.FileMode(0755)) assert.NoError(t, err) err = ioutil.WriteFile(exerciseA.MetadataFilepath(), []byte{}, os.FileMode(0600)) diff --git a/workspace/workspace_test.go b/workspace/workspace_test.go index 2d971d73b..8231ba94f 100644 --- a/workspace/workspace_test.go +++ b/workspace/workspace_test.go @@ -6,6 +6,7 @@ import ( "path/filepath" "runtime" "sort" + "strings" "testing" "github.com/stretchr/testify/assert" @@ -60,11 +61,11 @@ func TestWorkspaceExercises(t *testing.T) { b2 := filepath.Join(tmpDir, "track-b", "exercise-two") for _, path := range []string{a1, a2, b1, b2} { - path := filepath.Join(path, ignoreSubdir) + path := filepath.Dir(NewExerciseFromDir(path).MetadataFilepath()) err := os.MkdirAll(path, os.FileMode(0755)) assert.NoError(t, err) - if path != filepath.Join(a2, ignoreSubdir) { + if !strings.HasPrefix(path, a2) { err = ioutil.WriteFile(filepath.Join(path, solutionFilename), []byte{}, os.FileMode(0600)) assert.NoError(t, err) }