Skip to content

Commit

Permalink
fix file path shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssaruth committed Jan 13, 2024
1 parent 0c8bb6d commit 15a72d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/test/kotlin/dartzee/TestUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import io.mockk.MockKMatcherScope
import java.awt.Color
import java.awt.Component
import java.awt.Point
import java.io.File
import java.time.Instant
import java.time.LocalDate
import java.time.ZoneId
Expand Down Expand Up @@ -222,7 +223,7 @@ fun FileUploader.uploadFileFromResource(resourceName: String) {
chooserDialog.clickChild<JButton>(text = "Open")
flushEdt()

getChild<JTextField>().text shouldBe rsrcPath
getChild<JTextField>().text shouldBe File(rsrcPath).path
clickChild<JButton>(text = "Upload")
flushEdt()
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/dartzee/bean/TestFileUploader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TestFileUploader : AbstractTest() {
@Test
fun `Should be able to upload a file`() {
val rsrc = javaClass.getResource("/outer-wilds.jpeg")!!
val path = rsrc.path
val path = File(rsrc.path).path

val uploader = FileUploader(FileNameExtensionFilter("all", "*"))
val listener = makeFileListener(true)
Expand All @@ -65,7 +65,7 @@ class TestFileUploader : AbstractTest() {
@Test
fun `Should not clear text if file listener reports failure`() {
val rsrc = javaClass.getResource("/outer-wilds.jpeg")!!
val path = rsrc.path
val path = File(rsrc.path).path

val uploader = FileUploader(FileNameExtensionFilter("all", "*"))
val listener = makeFileListener(false)
Expand Down

0 comments on commit 15a72d1

Please sign in to comment.