@@ -70,7 +70,7 @@ func TestSubmitNonExistentFile(t *testing.T) {
7070 assert .Regexp (t , "cannot be found" , err .Error ())
7171}
7272
73- func TestSubmitExerciseWithoutSolutionMetadataFile (t * testing.T ) {
73+ func TestSubmitExerciseWithoutMetadataFile (t * testing.T ) {
7474 tmpDir , err := ioutil .TempDir ("" , "no-metadata-file" )
7575 defer os .RemoveAll (tmpDir )
7676 assert .NoError (t , err )
@@ -147,7 +147,7 @@ func TestSubmitFiles(t *testing.T) {
147147
148148 dir := filepath .Join (tmpDir , "bogus-track" , "bogus-exercise" )
149149 os .MkdirAll (filepath .Join (dir , "subdir" ), os .FileMode (0755 ))
150- writeFakeSolution (t , dir , "bogus-track" , "bogus-exercise" )
150+ writeFakeMetadata (t , dir , "bogus-track" , "bogus-exercise" )
151151
152152 file1 := filepath .Join (dir , "file-1.txt" )
153153 err = ioutil .WriteFile (file1 , []byte ("This is file 1." ), os .FileMode (0755 ))
@@ -186,7 +186,7 @@ func TestSubmitFiles(t *testing.T) {
186186 assert .Equal (t , "This is the readme." , submittedFiles ["README.md" ])
187187}
188188
189- func TestLegacySolutionMetadataMigration (t * testing.T ) {
189+ func TestLegacyMetadataMigration (t * testing.T ) {
190190 oldOut := Out
191191 oldErr := Err
192192 Out = ioutil .Discard
@@ -207,14 +207,14 @@ func TestLegacySolutionMetadataMigration(t *testing.T) {
207207 dir := filepath .Join (tmpDir , "bogus-track" , "bogus-exercise" )
208208 os .MkdirAll (dir , os .FileMode (0755 ))
209209
210- solution := & workspace.Solution {
210+ metadata := & workspace.ExerciseMetadata {
211211 ID : "bogus-solution-uuid" ,
212212 Track : "bogus-track" ,
213213 Exercise : "bogus-exercise" ,
214214 URL : "http://example.com/bogus-url" ,
215215 IsRequester : true ,
216216 }
217- b , err := json .Marshal (solution )
217+ b , err := json .Marshal (metadata )
218218 assert .NoError (t , err )
219219 exercise := workspace .NewExerciseFromDir (dir )
220220 err = ioutil .WriteFile (exercise .LegacyMetadataFilepath (), b , os .FileMode (0600 ))
@@ -271,7 +271,7 @@ func TestSubmitWithEmptyFile(t *testing.T) {
271271 dir := filepath .Join (tmpDir , "bogus-track" , "bogus-exercise" )
272272 os .MkdirAll (dir , os .FileMode (0755 ))
273273
274- writeFakeSolution (t , dir , "bogus-track" , "bogus-exercise" )
274+ writeFakeMetadata (t , dir , "bogus-track" , "bogus-exercise" )
275275
276276 v := viper .New ()
277277 v .Set ("token" , "abc123" )
@@ -317,7 +317,7 @@ func TestSubmitWithEnormousFile(t *testing.T) {
317317 dir := filepath .Join (tmpDir , "bogus-track" , "bogus-exercise" )
318318 os .MkdirAll (dir , os .FileMode (0755 ))
319319
320- writeFakeSolution (t , dir , "bogus-track" , "bogus-exercise" )
320+ writeFakeMetadata (t , dir , "bogus-track" , "bogus-exercise" )
321321
322322 v := viper .New ()
323323 v .Set ("token" , "abc123" )
@@ -360,7 +360,7 @@ func TestSubmitFilesForTeamExercise(t *testing.T) {
360360
361361 dir := filepath .Join (tmpDir , "teams" , "bogus-team" , "bogus-track" , "bogus-exercise" )
362362 os .MkdirAll (filepath .Join (dir , "subdir" ), os .FileMode (0755 ))
363- writeFakeSolution (t , dir , "bogus-track" , "bogus-exercise" )
363+ writeFakeMetadata (t , dir , "bogus-track" , "bogus-exercise" )
364364
365365 file1 := filepath .Join (dir , "file-1.txt" )
366366 err = ioutil .WriteFile (file1 , []byte ("This is file 1." ), os .FileMode (0755 ))
@@ -409,7 +409,7 @@ func TestSubmitOnlyEmptyFile(t *testing.T) {
409409 dir := filepath .Join (tmpDir , "bogus-track" , "bogus-exercise" )
410410 os .MkdirAll (dir , os .FileMode (0755 ))
411411
412- writeFakeSolution (t , dir , "bogus-track" , "bogus-exercise" )
412+ writeFakeMetadata (t , dir , "bogus-track" , "bogus-exercise" )
413413
414414 v := viper .New ()
415415 v .Set ("token" , "abc123" )
@@ -435,11 +435,11 @@ func TestSubmitFilesFromDifferentSolutions(t *testing.T) {
435435
436436 dir1 := filepath .Join (tmpDir , "bogus-track" , "bogus-exercise-1" )
437437 os .MkdirAll (dir1 , os .FileMode (0755 ))
438- writeFakeSolution (t , dir1 , "bogus-track" , "bogus-exercise-1" )
438+ writeFakeMetadata (t , dir1 , "bogus-track" , "bogus-exercise-1" )
439439
440440 dir2 := filepath .Join (tmpDir , "bogus-track" , "bogus-exercise-2" )
441441 os .MkdirAll (dir2 , os .FileMode (0755 ))
442- writeFakeSolution (t , dir2 , "bogus-track" , "bogus-exercise-2" )
442+ writeFakeMetadata (t , dir2 , "bogus-track" , "bogus-exercise-2" )
443443
444444 file1 := filepath .Join (dir1 , "file-1.txt" )
445445 err = ioutil .WriteFile (file1 , []byte ("This is file 1." ), os .FileMode (0755 ))
@@ -510,7 +510,7 @@ func TestSubmitRelativePath(t *testing.T) {
510510 dir := filepath .Join (tmpDir , "bogus-track" , "bogus-exercise" )
511511 os .MkdirAll (dir , os .FileMode (0755 ))
512512
513- writeFakeSolution (t , dir , "bogus-track" , "bogus-exercise" )
513+ writeFakeMetadata (t , dir , "bogus-track" , "bogus-exercise" )
514514
515515 v := viper .New ()
516516 v .Set ("token" , "abc123" )
@@ -534,14 +534,14 @@ func TestSubmitRelativePath(t *testing.T) {
534534 assert .Equal (t , "This is a file." , submittedFiles ["file.txt" ])
535535}
536536
537- func writeFakeSolution (t * testing.T , dir , trackID , exerciseSlug string ) {
538- solution := & workspace.Solution {
537+ func writeFakeMetadata (t * testing.T , dir , trackID , exerciseSlug string ) {
538+ metadata := & workspace.ExerciseMetadata {
539539 ID : "bogus-solution-uuid" ,
540540 Track : trackID ,
541541 Exercise : exerciseSlug ,
542542 URL : "http://example.com/bogus-url" ,
543543 IsRequester : true ,
544544 }
545- err := solution .Write (dir )
545+ err := metadata .Write (dir )
546546 assert .NoError (t , err )
547547}
0 commit comments