val car = mockkClass(Car::class)
every { car.drive(Direction.NORTH) } returns Outcome.OK
car.drive(Direction.NORTH) // returns OK
verify { car.drive(Direction.NORTH) }
vitaliy
09/24/2020, 12:19 PM
I’m not sure though if this would work when File is instantiated inside of the method under test
d
Davide Giuseppe Farella
09/24/2020, 12:19 PM
But child File is created internally from the class, anyway I solved with
Copy code
@get:Rule
val folder: TemporaryFolder = TemporaryFolder()