Skip to content

Commit

Permalink
Test validate-repo-config via Main
Browse files Browse the repository at this point in the history
  • Loading branch information
fthomas committed Dec 15, 2023
1 parent 7a7bd86 commit fa40882
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CliTest extends FunSuite {
assert(!obtained.bitbucketServerCfg.useDefaultReviewers)
}

val minimumRequiredParams = List(
private val minimumRequiredParams = List(
List("--workspace", "a"),
List("--repos-file", "b"),
List("--git-author-email", "d"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.scalasteward.core.repoconfig

import better.files.File
import cats.effect.ExitCode
import cats.effect.unsafe.implicits.global
import cats.effect.{ExitCode, IO}
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import org.scalasteward.core.application.ValidateRepoConfigContext
import org.scalasteward.core.Main

class ValidateRepoConfigAlgTest extends munit.FunSuite {

Expand All @@ -19,7 +19,7 @@ class ValidateRepoConfigAlgTest extends munit.FunSuite {
)
)

val obtained = ValidateRepoConfigContext.run[IO](tmpFile).unsafeRunSync()
val obtained = Main.run(List("validate-repo-config", tmpFile.pathAsString)).unsafeRunSync()
(tmpFile, obtained)
},
teardown = { case (file, _) =>
Expand Down Expand Up @@ -59,8 +59,7 @@ class ValidateRepoConfigAlgTest extends munit.FunSuite {
}

test("rejects non-existent config file") {
val nonExistentFile = File("/", "scripts", "script")
val obtained = ValidateRepoConfigContext.run[IO](nonExistentFile).unsafeRunSync()
val obtained = Main.run(List("validate-repo-config", "/scripts.script")).unsafeRunSync()

assertEquals(obtained, ExitCode.Error)
}
Expand Down

0 comments on commit fa40882

Please sign in to comment.