Skip to content

Commit

Permalink
#146 Fix failing tests from extras module on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
jirifilip committed Jan 30, 2023
1 parent a1cc183 commit 7512604
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ import org.scalatest.wordspec.AnyWordSpec
import za.co.absa.pramen.core.samples.SampleCaseClass
import za.co.absa.pramen.core.utils.JsonUtils

import scala.compat.Platform.EOL

class JsonUtilsSuite extends AnyWordSpec {

private val lineSeparator = System.lineSeparator()
private val sample = SampleCaseClass.getDummy
private val sampleJson =
"""{
Expand All @@ -30,7 +33,7 @@ class JsonUtilsSuite extends AnyWordSpec {
| "longValue" : 10000000000,
| "dateValue" : "2020-08-10",
| "listStr" : [ "Str1", "Str2" ]
|}""".stripMargin
|}""".replace(EOL, "\n").stripMargin

"asJson" should {
"return a JSON representation of a case class" in {
Expand All @@ -43,9 +46,9 @@ class JsonUtilsSuite extends AnyWordSpec {
}

"asJsonPretty" should {
"return the number of milliseconds for values less than 1 second" in {
"prettify a JSON" in {
val sample = SampleCaseClass.getDummy
val actualJson = JsonUtils.asJsonPretty(sample)
val actualJson = JsonUtils.asJsonPretty(sample).replace(EOL, "\n")

assert(actualJson == sampleJson)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ trait TempDirFixture {
val fullPathToTheFile = Paths.get(path, fileName).toString
val f = new RandomAccessFile(fullPathToTheFile, "rw")
f.setLength(size)
f.close()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class CmdLineLineConfigSuite extends AnyWordSpec {
assert(!config.getBoolean(USE_LOCK))
}

"return the origina config if undercover is not specified" in {
"return the original config if undercover is not specified" in {
val cmd = CmdLineConfig.parseCmdLine(Array("--workflow", "dummy.config"))
val config = CmdLineConfig.applyCmdLineToConfig(populatedConfig, cmd.get)

Expand Down

0 comments on commit 7512604

Please sign in to comment.