@@ -23,26 +23,26 @@ class BaseHtmlTest:
2323 withGeneratedDoc(Seq (" site" ), docsRoot = Some (base.toAbsolutePath.toString))(op)
2424
2525 def withGeneratedDoc (
26- pcks : Seq [String ],
27- docsRoot : Option [String ] = None ,
28- customArgs : Option [Scaladoc .Args ] = None ,
29- )(
30- op : ProjectContext ?=> Unit ,
31- ): Unit =
32- val dest = customArgs.map(_.output).getOrElse(Files .createTempDirectory(" test-doc" ).toFile)
33- try
34- val args = customArgs.getOrElse(Scaladoc .Args (
35- name = projectName,
36- tastyFiles = pcks.flatMap(tastyFiles(_)),
37- output = dest,
38- docsRoot = docsRoot,
39- projectVersion = Some (projectVersion)
40- ))
41- Scaladoc .run(args)(using testContext)
42- op(using ProjectContext (args.output.toPath))
43-
44- finally IO .delete(dest)
26+ pcks : Seq [String ],
27+ docsRoot : Option [String ] = None ,
28+ customArgs : Option [Scaladoc .Args ] = None ,
29+ )(
30+ op : ProjectContext ?=> Unit ,
31+ ): Unit =
32+ val dest = customArgs.fold(Files .createTempDirectory(" test-doc" ).toFile)(_.output)
33+ try
34+ val args = customArgs.getOrElse(Scaladoc .Args (
35+ name = projectName,
36+ tastyFiles = pcks.flatMap(tastyFiles(_)),
37+ output = dest,
38+ docsRoot = docsRoot,
39+ projectVersion = Some (projectVersion)
40+ ))
41+ Scaladoc .run(args)(using testContext)
42+ op(using ProjectContext (args.output.toPath))
4543
44+ finally IO .delete(dest)
45+ end withGeneratedDoc
4646 class DocumentContext (d : Document , path : Path ):
4747 import collection .JavaConverters ._
4848
0 commit comments