[Infrastructure] Assert dumps don't exist without directive
#KT-58697 Fixed
This commit is contained in:
committed by
Space Team
parent
42f6eb4eb4
commit
5e83350576
@@ -9,6 +9,8 @@ import java.io.File
|
||||
import java.nio.file.Path
|
||||
|
||||
abstract class Assertions {
|
||||
val isTeamCityBuild: Boolean = System.getenv("TEAMCITY_VERSION") != null
|
||||
|
||||
fun assertEqualsToFile(expectedFile: File, actual: String, sanitizer: (String) -> String = { it }) {
|
||||
assertEqualsToFile(expectedFile, actual, sanitizer) { "Actual data differs from file content" }
|
||||
}
|
||||
@@ -24,6 +26,15 @@ abstract class Assertions {
|
||||
message: (() -> String)
|
||||
)
|
||||
|
||||
fun assertFileDoesntExist(file: File, errorMessage: () -> String) {
|
||||
if (file.exists()) {
|
||||
if (!isTeamCityBuild) {
|
||||
file.delete()
|
||||
}
|
||||
fail(errorMessage)
|
||||
}
|
||||
}
|
||||
|
||||
abstract fun assertEquals(expected: Any?, actual: Any?, message: (() -> String)? = null)
|
||||
abstract fun assertNotEquals(expected: Any?, actual: Any?, message: (() -> String)? = null)
|
||||
abstract fun assertTrue(value: Boolean, message: (() -> String)? = null)
|
||||
|
||||
Reference in New Issue
Block a user