mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Meta: update bashunit helper functions due to breaking change (#480)
This commit is contained in:
parent
b9ed7bc40e
commit
9167c65714
|
|
@ -4,7 +4,7 @@ function set_up_before_script() {
|
|||
source bin/git-forgit
|
||||
|
||||
# create a new git repository in a temp directory
|
||||
cd "$(temp_dir)" || return 1
|
||||
cd "$(bashunit::temp_dir)" || return 1
|
||||
git init --quiet
|
||||
|
||||
# create files to test against
|
||||
|
|
@ -16,7 +16,7 @@ function set_up_before_script() {
|
|||
|
||||
# @data_provider provider_clean_select_files
|
||||
function test_forgit_clean_select_files_preview() {
|
||||
mock "fzf" "sed -n ${1}p"
|
||||
bashunit::mock "fzf" "sed -n ${1}p"
|
||||
|
||||
local file
|
||||
file=$(_forgit_clean_select_files)
|
||||
|
|
@ -25,8 +25,8 @@ function test_forgit_clean_select_files_preview() {
|
|||
}
|
||||
|
||||
function provider_clean_select_files() {
|
||||
data_set 1
|
||||
data_set 2
|
||||
data_set 3
|
||||
data_set 4
|
||||
bashunit::data_set 1
|
||||
bashunit::data_set 2
|
||||
bashunit::data_set 3
|
||||
bashunit::data_set 4
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
function test_exit_when_fzf_is_not_installed() {
|
||||
# Error code 127 = "command not found"
|
||||
mock fzf "return 127"
|
||||
bashunit::mock fzf "return 127"
|
||||
|
||||
output=$(bin/git-forgit)
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ function test_exit_when_fzf_is_not_installed() {
|
|||
|
||||
# @data_provider fzf_versions_below_required_version
|
||||
function test_exit_when_fzf_version_is_below_required_version() {
|
||||
mock "fzf" "echo '$1'"
|
||||
bashunit::mock "fzf" "echo '$1'"
|
||||
|
||||
output=$(bin/git-forgit)
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ function fzf_versions_below_required_version() {
|
|||
|
||||
# @data_provider fzf_versions_satisfying_required_version
|
||||
function test_pass_when_fzf_version_satisfies_required_version() {
|
||||
mock "fzf" "echo '$1'"
|
||||
bashunit::mock "fzf" "echo '$1'"
|
||||
|
||||
output=$(bin/git-forgit)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ function test_forgit_get_files_from_diff_line() {
|
|||
}
|
||||
|
||||
function provider_diff_lines() {
|
||||
data_set "[A] newfile" "newfile"
|
||||
data_set "[D] oldfile with spaces" "oldfile with spaces"
|
||||
data_set "[R100] file -> another file" "file" "another file"
|
||||
data_set "[M] \"file with\ttab.txt\"" "\"file with\ttab.txt\""
|
||||
bashunit::data_set "[A] newfile" "newfile"
|
||||
bashunit::data_set "[D] oldfile with spaces" "oldfile with spaces"
|
||||
bashunit::data_set "[R100] file -> another file" "file" "another file"
|
||||
bashunit::data_set "[M] \"file with\ttab.txt\"" "\"file with\ttab.txt\""
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue