From 9167c657143dc79001f22b7b50dc643fd1e0751a Mon Sep 17 00:00:00 2001 From: sandr01d <88739791+sandr01d@users.noreply.github.com> Date: Mon, 8 Dec 2025 20:12:34 +0100 Subject: [PATCH] Meta: update bashunit helper functions due to breaking change (#480) --- tests/clean-select-files.test.sh | 12 ++++++------ tests/fzf.test.sh | 6 +++--- tests/helper-functions.test.sh | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/clean-select-files.test.sh b/tests/clean-select-files.test.sh index 174bedd..8faaddd 100644 --- a/tests/clean-select-files.test.sh +++ b/tests/clean-select-files.test.sh @@ -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 } diff --git a/tests/fzf.test.sh b/tests/fzf.test.sh index 067764f..9b738ec 100644 --- a/tests/fzf.test.sh +++ b/tests/fzf.test.sh @@ -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) diff --git a/tests/helper-functions.test.sh b/tests/helper-functions.test.sh index 30096c3..0cc0eab 100644 --- a/tests/helper-functions.test.sh +++ b/tests/helper-functions.test.sh @@ -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\"" }