@@ -21,9 +21,9 @@ import zio.test.*
2121
2222object CodeExampleSpec extends DefaultRunnableSpec {
2323
24- val exampleFakeTestingFilename = " test-data/sample1/fake-testing-pi.sc"
24+ val exampleFakeTestingFilename = " test-data/sample1/fake-testing-pi.sc"
2525 val exampleFakeTestingSearchRoot = " test-data/sample1"
26- val exampleFakeTestingPiContent =
26+ val exampleFakeTestingPiContent =
2727 """ // summary : Simplest scalatest test framework usage.
2828 |// keywords : scalatest, pi, @testable
2929 |// publish : gist, snippet
@@ -41,32 +41,33 @@ object CodeExampleSpec extends DefaultRunnableSpec {
4141 val t1 = testM(" make an example" ) {
4242 for {
4343 example <- CodeExample .makeExample(exampleFakeTestingFilename, exampleFakeTestingSearchRoot, Task (exampleFakeTestingPiContent))
44- } yield
45- assert(example.filename)(equalTo(" fake-testing-pi.sc" )) &&
46- assert(example.category)(equalTo(None )) &&
47- assert(example.summary)(equalTo(Some (" Simplest scalatest test framework usage." ))) &&
48- assert(example.fileExt)(equalTo(" sc" )) &&
49- assert(example.publish)(equalTo(List (" gist" , " snippet" ))) &&
50- assert(example.authors)(equalTo(List (" David Crosson" ))) &&
51- assert(example.keywords)(equalTo(List (" scalatest" , " pi" , " @testable" ))) &&
52- assert(example.uuid)(equalTo(Some (" 8f2e14ba-9856-4500-80ab-3b9ba2234ce2" ))) &&
53- assert(example.content)(matchesRegex(" (?s).*id [:] 8f2e14ba-9856-4500-80ab-3b9ba2234ce2.*" )) &&
54- assert(example.checksum)(equalTo(" 5f6dd8a2d2f813ee946542161503d61cb9a8074e" ))
44+ } yield assert(example.filename)(equalTo(" fake-testing-pi.sc" )) &&
45+ assert(example.category)(equalTo(None )) &&
46+ assert(example.summary)(equalTo(Some (" Simplest scalatest test framework usage." ))) &&
47+ assert(example.fileExt)(equalTo(" sc" )) &&
48+ assert(example.publish)(equalTo(List (" gist" , " snippet" ))) &&
49+ assert(example.authors)(equalTo(List (" David Crosson" ))) &&
50+ assert(example.keywords)(equalTo(List (" scalatest" , " pi" , " @testable" ))) &&
51+ assert(example.uuid)(equalTo(Some (" 8f2e14ba-9856-4500-80ab-3b9ba2234ce2" ))) &&
52+ assert(example.content)(matchesRegex(" (?s).*id [:] 8f2e14ba-9856-4500-80ab-3b9ba2234ce2.*" )) &&
53+ assert(example.checksum)(equalTo(" 5f6dd8a2d2f813ee946542161503d61cb9a8074e" ))
5554 }
5655
5756 // ----------------------------------------------------------------------------------------------
5857 val t2 = test(" automatically recognize categories from sub-directory name" ) {
5958 val inputsAndExpectedResults : List [((String , String ), Option [String ])] = List (
60- (" test-data/fake-testing-pi.sc" , " test-data/" ) -> None ,
61- (" test-data/fake-testing-pi.sc" , " " ) -> Some (" test-data" ),
59+ (" test-data/fake-testing-pi.sc" , " test-data/" ) -> None ,
60+ (" test-data/fake-testing-pi.sc" , " " ) -> Some (" test-data" ),
6261 (" test-data/sample1/fake-testing-pi.sc" , " test-data/sample1" ) -> None ,
63- (" test-data/sample1/fake-testing-pi.sc" , " test-data" ) -> Some (" sample1" ),
64- (" test-data/sample1/fake-testing-pi.sc" , " test-data/" ) -> Some (" sample1" ),
65- (" test-data/sample1/fake-testing-pi.sc" , " " ) -> Some (" test-data/sample1" )
62+ (" test-data/sample1/fake-testing-pi.sc" , " test-data" ) -> Some (" sample1" ),
63+ (" test-data/sample1/fake-testing-pi.sc" , " test-data/" ) -> Some (" sample1" ),
64+ (" test-data/sample1/fake-testing-pi.sc" , " " ) -> Some (" test-data/sample1" )
6665 )
67- inputsAndExpectedResults.map { case ((filename, searchRoot), expectedResult) =>
68- assert(CodeExample .exampleCategoryFromFilepath(filename, searchRoot))(equalTo(expectedResult))
69- }.reduce(_ && _)
66+ inputsAndExpectedResults
67+ .map { case ((filename, searchRoot), expectedResult) =>
68+ assert(CodeExample .exampleCategoryFromFilepath(filename, searchRoot))(equalTo(expectedResult))
69+ }
70+ .reduce(_ && _)
7071 }
7172
7273 // ----------------------------------------------------------------------------------------------
0 commit comments