Misc Changes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package solutions.tretter.githugandroid
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
@@ -97,6 +98,30 @@ class LevelSolutionsTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun reportedRegressionCommandsDoNotSolveLevels() {
|
||||
val statusRepo = statusLevel().setup()
|
||||
assertEquals(listOf("database.yml"), statusRepo.files.map { it.name })
|
||||
|
||||
val gitBinary = testGitBinary()
|
||||
val runtimeRoot = testSandboxRoot().apply {
|
||||
deleteRecursively()
|
||||
mkdirs()
|
||||
}
|
||||
|
||||
val mergeExercise = mergeLevel()
|
||||
val mergeRuntime = GitRepositoryRuntime(runtimeRoot, gitBinary)
|
||||
val mergeRepo = mergeRuntime.prepareLevel(mergeExercise)
|
||||
val (switchedRepo, _) = mergeRuntime.execute(mergeExercise, mergeRepo, "git switch feature")
|
||||
assertFalse("Switching to feature must not solve the merge level.", mergeExercise.validator(switchedRepo, "git switch feature"))
|
||||
|
||||
val fetchExercise = fetchLevel()
|
||||
val fetchRuntime = GitRepositoryRuntime(runtimeRoot, gitBinary)
|
||||
val fetchRepo = fetchRuntime.prepareLevel(fetchExercise)
|
||||
val (pulledRepo, _) = fetchRuntime.execute(fetchExercise, fetchRepo, "git pull")
|
||||
assertFalse("Pulling must not solve the fetch level.", fetchExercise.validator(pulledRepo, "git pull"))
|
||||
}
|
||||
|
||||
private companion object {
|
||||
fun writeEvidenceLog(content: String) {
|
||||
val repoRoot = File(System.getProperty("user.dir") ?: ".")
|
||||
|
||||
Reference in New Issue
Block a user