Skip to content

Commit f4370e2

Browse files
committed
Remove FileAlg#home
1 parent 885a6ae commit f4370e2

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

modules/core/src/main/scala/org/scalasteward/core/io/FileAlg.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ trait FileAlg[F[_]] {
3232

3333
def ensureExists(dir: File): F[File]
3434

35-
def home: F[File]
36-
3735
def isDirectory(file: File): F[Boolean]
3836

3937
def isRegularFile(file: File): F[Boolean]
@@ -99,9 +97,6 @@ object FileAlg {
9997
dir
10098
}
10199

102-
override def home: F[File] =
103-
F.delay(File.home)
104-
105100
override def isDirectory(file: File): F[Boolean] =
106101
F.blocking(file.isDirectory(File.LinkOptions.noFollow))
107102

modules/core/src/test/scala/org/scalasteward/core/io/FileAlgTest.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ class FileAlgTest extends FunSuite {
5656
}
5757

5858
test("editFile: nonexistent file") {
59-
val (state, edited) = (for {
60-
home <- fileAlg.home
61-
edited <- fileAlg.editFile(home / "does-not-exists.txt", Some.apply)
62-
} yield edited).runSA(MockState.empty).unsafeRunSync()
59+
val (state, edited) = fileAlg
60+
.editFile(mockRoot / "does-not-exists.txt", Some.apply)
61+
.runSA(MockState.empty)
62+
.unsafeRunSync()
6363

6464
val expected =
6565
MockState.empty.copy(trace = Vector(Cmd("read", s"$mockRoot/does-not-exists.txt")))

modules/core/src/test/scala/org/scalasteward/core/io/MockFileAlg.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ class MockFileAlg extends FileAlg[MockEff] {
1515
override def ensureExists(dir: File): MockEff[File] =
1616
Kleisli(_.update(_.exec(List("mkdir", "-p", dir.pathAsString))) >> ioFileAlg.ensureExists(dir))
1717

18-
override def home: MockEff[File] =
19-
Kleisli.pure(MockConfig.mockRoot)
20-
2118
override def isDirectory(file: File): MockEff[Boolean] =
2219
Kleisli(_.update(_.exec(List("test", "-d", file.pathAsString))) >> ioFileAlg.isDirectory(file))
2320

0 commit comments

Comments
 (0)