Skip to content

Commit 11164c3

Browse files
committed
Merge pull request #4 from codacy/remove-unused-methods
Remove unused methods from FileHelper
2 parents a4e01b5 + bbf2ec3 commit 11164c3

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

src/main/scala/codacy/dockerApi/utils/FileHelper.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ import java.nio.file.{Files, Path, Paths, StandardOpenOption}
66

77
object FileHelper {
88

9-
def createFile(path: String, content: String): Path = {
10-
Files.write(
11-
Files.createFile(Paths.get(path)),
12-
content.getBytes(StandardCharsets.UTF_8),
13-
StandardOpenOption.CREATE
14-
)
15-
}
16-
179
def createTmpFile(content: String, prefix: String = "config", suffix: String = ".conf"): Path = {
1810
Files.write(
1911
Files.createTempFile(prefix, suffix),

src/test/scala/codacy/dockerApi/utils/FileHelperTest.scala

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,8 @@ class FileHelperTest extends FlatSpec with Matchers {
4646
"FileHelper" should "createTmpFile" in {
4747
val fileTmp = FileHelper.createTmpFile("foo", "prefix", ".ext").toString
4848

49-
java.nio.file.Paths.get(fileTmp).getFileName.toString should startWith ("prefix")
50-
fileTmp should endWith (".ext")
49+
java.nio.file.Paths.get(fileTmp).getFileName.toString should startWith("prefix")
50+
fileTmp should endWith(".ext")
5151
io.Source.fromFile(fileTmp).mkString should be("foo")
5252
}
53-
54-
"FileHelper" should "createFile" in {
55-
val pathString: String = "/tmp/fileHelperFilename.ext"
56-
new java.io.File(pathString).delete()
57-
58-
val file = FileHelper.createFile(pathString, "foo").toString
59-
io.Source.fromFile(file).mkString should be("foo")
60-
}
61-
}
53+
}

0 commit comments

Comments
 (0)