Misc Changes
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package solutions.tretter.githugandroid
|
||||
|
||||
/**
|
||||
* Port of the upstream ruby-githug `rebase` 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 rebaseLevel(): Level = level(
|
||||
id = "rebase",
|
||||
title = "Rebase",
|
||||
description = "We are using a git rebase workflow and the feature branch is ready to go into master. Let's rebase the feature branch onto our master branch.",
|
||||
hints = listOf("You want to research the `git rebase` command"),
|
||||
commandSuggestions = listOf("git checkout feature", "git rebase master"),
|
||||
setup = { RepoState(initialized = true, headBranch = "feature", branches = mapOf("master" to 2, "feature" to 3)) },
|
||||
validator = repoPredicate { repo -> repo.headBranch == "feature" && (repo.branches["feature"] ?: 0) >= (repo.branches["master"] ?: 0) },
|
||||
testCases = listOf(
|
||||
levelTestCase("rebase feature on master", "git rebase master"),
|
||||
levelTestCase("checkout then rebase", "git checkout feature", "git rebase master"),
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user