22 lines
1.0 KiB
Kotlin
22 lines
1.0 KiB
Kotlin
package solutions.tretter.githugandroid
|
|
|
|
/**
|
|
* Port of the upstream ruby-githug `commit_in_future` level.
|
|
*
|
|
* Setup documents the repository shape the learner explores. Evaluation is kept
|
|
* state-based whenever the exercise changes repository objects; answer-only
|
|
* levels intentionally validate the answer entered at the prompt.
|
|
*/
|
|
internal fun commitInFutureLevel(): Level = level(
|
|
id = "commit_in_future",
|
|
title = "Commit In Future",
|
|
description = "Commit your changes with the future date (e.g. tomorrow).",
|
|
hints = listOf("Build a time format, and commit your code using --date parameter."),
|
|
commandSuggestions = listOf("git commit --date tomorrow -m \"Future commit\""),
|
|
setup = { RepoState(initialized = true, files = listOf(GitFile("README", staged = true)), branches = mapOf("master" to 0)) },
|
|
validator = repoPredicate { repo -> repo.commits.isNotEmpty() },
|
|
testCases = listOf(
|
|
levelTestCase("commit with date option", "git commit --date tomorrow -m \"Future commit\""),
|
|
),
|
|
)
|