Misc Changes
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package solutions.tretter.githugandroid
|
||||
|
||||
/**
|
||||
* Port of the upstream ruby-githug `pull` 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 pullLevel(): Level = level(
|
||||
id = "pull",
|
||||
title = "Pull",
|
||||
description = "You need to pull changes from your origin repository.",
|
||||
hints = listOf("Check out the remote repositories and research `git pull`."),
|
||||
commandSuggestions = listOf("git pull origin master"),
|
||||
setup = { RepoState(initialized = true, remotes = mapOf("origin" to "https://github.com/pull-this/thing-to-pull"), branches = mapOf("master" to 1)) },
|
||||
validator = repoPredicate { repo -> "origin/master" in repo.fetchedBranches && (repo.branches["master"] ?: 0) >= 2 },
|
||||
testCases = listOf(
|
||||
levelTestCase("pull explicit remote branch", "git pull origin master"),
|
||||
levelTestCase("pull default origin", "git pull"),
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user