Skip to content

Commit 61382df

Browse files
committed
add test for team exercises in workspace
1 parent 5de1213 commit 61382df

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

workspace/workspace_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ func TestWorkspacePotentialExercises(t *testing.T) {
2020
b1 := filepath.Join(tmpDir, "track-b", "exercise-one")
2121
b2 := filepath.Join(tmpDir, "track-b", "exercise-two")
2222

23+
// It should find teams exercises
24+
team := filepath.Join(tmpDir, "teams", "some-team", "track-c", "exercise-one")
25+
2326
// It should ignore other people's exercises.
2427
alice := filepath.Join(tmpDir, "users", "alice", "track-a", "exercise-one")
2528

2629
// It should ignore nested dirs within exercises.
2730
nested := filepath.Join(a1, "subdir", "deeper-dir", "another-deep-dir")
2831

29-
for _, path := range []string{a1, b1, b2, alice, nested} {
32+
for _, path := range []string{a1, b1, b2, team, alice, nested} {
3033
err := os.MkdirAll(path, os.FileMode(0755))
3134
assert.NoError(t, err)
3235
}
@@ -36,7 +39,7 @@ func TestWorkspacePotentialExercises(t *testing.T) {
3639

3740
exercises, err := ws.PotentialExercises()
3841
assert.NoError(t, err)
39-
if assert.Equal(t, 3, len(exercises)) {
42+
if assert.Equal(t, 4, len(exercises)) {
4043
paths := make([]string, len(exercises))
4144
for i, e := range exercises {
4245
paths[i] = e.Path()
@@ -46,6 +49,7 @@ func TestWorkspacePotentialExercises(t *testing.T) {
4649
assert.Equal(t, paths[0], "track-a/exercise-one")
4750
assert.Equal(t, paths[1], "track-b/exercise-one")
4851
assert.Equal(t, paths[2], "track-b/exercise-two")
52+
assert.Equal(t, paths[3], "track-c/exercise-one")
4953
}
5054
}
5155

0 commit comments

Comments
 (0)