Skip to content

Commit

Permalink
issue #1332 attempt to fix unit tests failing on Windows to due to li…
Browse files Browse the repository at this point in the history
…ne end differences.
  • Loading branch information
wajda committed Jun 4, 2024
1 parent 4184e77 commit cc92d9e
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package za.co.absa.spline.persistence.tx
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.mockito.MockitoSugar
import za.co.absa.commons.scalatest.WhitespaceNormalizations.whiteSpaceNormalised
import za.co.absa.spline.persistence.model.NodeDef

class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
Expand All @@ -31,7 +32,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
.addQuery(NativeQuery("db.BAR();"))
.generateJs()

generatedJS shouldEqual {
(generatedJS shouldEqual {
"""
|function (_params) {
| const _db = require('internal').db;
Expand All @@ -43,7 +44,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
| })(_db, _params[1]);
|}
|""".stripMargin
}
})(after being whiteSpaceNormalised)
}

it should "generate INSERT statements" in {
Expand All @@ -52,7 +53,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
.addQuery(InsertQuery(NodeDef.Operation).copy(ignoreExisting = true))
.generateJs()

generatedJS shouldEqual {
(generatedJS shouldEqual {
"""
|function (_params) {
| const _db = require('internal').db;
Expand All @@ -70,7 +71,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
| _db._collection("operation").insert(o, {silent:true}));
|}
|""".stripMargin
}
})(after being whiteSpaceNormalised)
}

it should "generate UPDATE statements" in {
Expand All @@ -79,7 +80,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
.addQuery(UpdateQuery(NodeDef.DataSource, s"${UpdateQuery.DocWildcard}.baz == 777", Map.empty))
.generateJs()

generatedJS shouldEqual {
(generatedJS shouldEqual {
"""
|function (_params) {
| const _db = require('internal').db;
Expand All @@ -97,6 +98,6 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
| `, {"b": _params[1]});
|}
|""".stripMargin
}
})(after being whiteSpaceNormalised)
}
}

0 comments on commit cc92d9e

Please sign in to comment.