package solutions.tretter.githugandroid

/**
 * Port of the upstream ruby-githug `push_tags` 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 pushTagsLevel(): Level = level(
    id = "push_tags",
    title = "Push Tags",
    description = "A tag in the local repository isn't pushed into remote repository. Push it now.",
    hints = listOf("Take a look at `--tags` flag of `git push`"),
    commandSuggestions = listOf("git push --tags"),
    setup = { RepoState(initialized = true, tags = listOf("tag_to_be_pushed"), branches = mapOf("master" to 2), remotes = mapOf("origin" to "remote")) },
    validator = repoPredicate { repo -> "tag_to_be_pushed" in repo.pushedTags },
    testCases = listOf(
        levelTestCase("push all tags", "git push --tags"),
        levelTestCase("push tags to origin", "git push origin --tags"),
    ),
)
