File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed
modules/core/src/test/scala/org/scalasteward/core Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ object MockContext {
19
19
whitelistedDirectories = Nil,
20
20
readOnlyDirectories = Nil,
21
21
disableSandbox = false,
22
- doNotFork = false
22
+ doNotFork = false,
23
+ keepCredentials = false
23
24
)
24
25
25
26
implicit val fileAlg: MockFileAlg = new MockFileAlg
Original file line number Diff line number Diff line change 1
1
package org.scalasteward.core.sbt
2
2
3
3
import better.files.File
4
+ import org.scalasteward.core.application.Config
4
5
import org.scalasteward.core.github.data.Repo
5
- import org.scalasteward.core.mock.MockContext.sbtAlg
6
- import org.scalasteward.core.mock.MockState
6
+ import org.scalasteward.core.mock.MockContext._
7
+ import org.scalasteward.core.mock.{MockContext, MockState}
7
8
import org.scalatest.{FunSuite, Matchers}
8
9
9
10
class SbtAlgTest extends FunSuite with Matchers {
@@ -50,16 +51,10 @@ class SbtAlgTest extends FunSuite with Matchers {
50
51
51
52
test("getUpdatesForRepo keeping credentials") {
52
53
val repo = Repo("fthomas", "refined")
53
- val configWithKeepCredentialsEnabled = ConfigTest.dummyConfig.copy(keepCredentials = true)
54
- val sbtAlgWithKeepCredentials = SbtAlg.create(
55
- configWithKeepCredentialsEnabled,
56
- fileAlg,
57
- loggerAlg,
58
- processAlg,
59
- workspaceAlg,
60
- implicitly[Monad[MockEnv]]
61
- )
62
- val state = sbtAlgWithKeepCredentials.getUpdatesForRepo(repo).runS(MockState.empty).value
54
+ implicit val config: Config = MockContext.config.copy(keepCredentials = true)
55
+ val sbtAlgKeepingCredentials = SbtAlg.create
56
+ val state =
57
+ sbtAlgKeepingCredentials.getUpdatesForRepo(repo).runS(MockState.empty).unsafeRunSync()
63
58
64
59
state shouldBe MockState.empty.copy(
65
60
commands = Vector(
You can’t perform that action at this time.
0 commit comments