Skip to content

Commit 2e8e991

Browse files
committed
chore: look at nextToLastLine here, not lastLine
1 parent 631c1b2 commit 2e8e991

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/core/src/test/scala/org/scalasteward/core/nurture/NurtureAlgTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ class NurtureAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] {
9090
}
9191

9292
test("preparePullRequest should not set labels if ForgeConfig.addLabels = false") {
93+
def nextToLast(L: Array[String]) = L(L.size - 2)
94+
9395
val config =
9496
MockConfig.config.copy(forgeCfg = MockConfig.config.forgeCfg.copy(addLabels = false))
9597
val nurtureAlg = context(config).nurtureAlg
@@ -114,9 +116,9 @@ class NurtureAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] {
114116
})
115117
nurtureAlg.preparePullRequest(updateData, edits).runA(state).map { obtained =>
116118
assert(obtained.labels.isEmpty)
117-
val lastLine = obtained.body.split("\n").last
119+
val nextToLastLine = nextToLast(obtained.body.split("\n"))
118120
assertEquals(
119-
lastLine,
121+
nextToLastLine,
120122
"labels: library-update, early-semver-minor, semver-spec-minor, version-scheme:early-semver, commit-count:1"
121123
)
122124
}

0 commit comments

Comments
 (0)