Skip to content

Commit

Permalink
[darwin] fix failing root ls test
Browse files Browse the repository at this point in the history
  • Loading branch information
ghthor committed Feb 27, 2024
1 parent a3affaf commit 97193af
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/lib/git/shell_shortcuts_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ oneTimeSetUp() {
# Test already wrapped commands
alias cat="exec_scmb_expand_args $cat_path"

sudo mkdir /aaa
root_test_dir=/aaa
if [ "$(uname)" = "Darwin" ]; then
root_test_dir=/Applications
else
sudo mkdir $root_test_dir
fi

# Run shortcut wrapping
source "$scmbDir/lib/git/shell_shortcuts.sh"
Expand Down Expand Up @@ -146,11 +151,13 @@ test_ls_with_file_shortcuts() {
assertTrue 'Shortcuts under /' 'ls_with_file_shortcuts / >/dev/null && [[ $e1 =~ ^/[^/]+$ ]]'

ls_with_file_shortcuts / >/dev/null
assertTrue "$e1 == /aaa" '[[ "$e1" == "/aaa" ]]'
assertTrue "$e1 == $root_test_dir" '[[ "$e1" == "$root_test_dir" ]]'

cd -
rm -r "$TEST_DIR" "$temp_file"
sudo rmdir /aaa
if [ "$(uname)" != "Darwin" ]; then
sudo rmdir "$root_test_dir"
fi
}

# load and run shUnit2
Expand Down

0 comments on commit 97193af

Please sign in to comment.