-
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for
git
IncludeIf
with hasconfig:remote
.
refs gh-198
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,56 @@ load test_helper | |
|
||
# git config ################################################################## | ||
|
||
@test "'_git_required()' recognizes git configuration that uses 'includeIf' with 'hasconfig:remote' when inside the specified directory." { | ||
{ | ||
export HOME="${_TMP_DIR}" | ||
|
||
git config --global user.name "Sample Name" | ||
git config --global user.email "[email protected]" | ||
|
||
cat <<HEREDOC > "${_TMP_DIR}/.gitconfig_conditional_include_example" | ||
[user] | ||
name = Example Name | ||
email = [email protected] | ||
HEREDOC | ||
|
||
cat <<HEREDOC >> "${_TMP_DIR}/.gitconfig" | ||
[includeIf "hasconfig:remote.*.url:file://${_TMP_DIR}*/**"] | ||
path = ${_TMP_DIR}/.gitconfig_conditional_include_example | ||
HEREDOC | ||
|
||
cat "${_TMP_DIR}/.gitconfig" | ||
|
||
"${_NB}" init | ||
"${_NB}" add "Sample File.md" --content "Sample content." | ||
|
||
"${_NB}" notebooks create "Example Notebook" | ||
"${_NB}" use "Example Notebook" | ||
|
||
_setup_remote_repo | ||
|
||
"${_NB}" remote set "${_GIT_REMOTE_URL}" <<< "y${_NEWLINE}1${_NEWLINE}" | ||
|
||
"${_NB}" add "Example File.md" --content "Example content." | ||
} | ||
|
||
run "${_NB}" show home:1 --author | ||
|
||
printf "\${status}: '%s'\\n" "${status}" | ||
printf "\${output}: '%s'\\n" "${output}" | ||
|
||
[[ "${status}" -eq 0 ]] | ||
[[ "${output}" == "Sample Name <[email protected]>" ]] | ||
|
||
run "${_NB}" show Example\ Notebook:1 --author | ||
|
||
printf "\${status}: '%s'\\n" "${status}" | ||
printf "\${output}: '%s'\\n" "${output}" | ||
|
||
[[ "${status}" -eq 0 ]] | ||
[[ "${output}" == "Example Name <[email protected]>" ]] | ||
} | ||
|
||
@test "'_git_required()' recognizes git configuration that uses 'includeIf' when inside the specified directory." { | ||
{ | ||
export HOME="${_TMP_DIR}" | ||
|