mirror of
https://github.com/jimeh/dotify.git
synced 2026-02-19 10:06:39 +00:00
Sanitize unfinished link action integration test a bit
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
source "../test-helper.sh"
|
source "../test-helper.sh"
|
||||||
source "../../src/lib/dotify-action.sh"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Integration test: link action
|
# Integration test: link action
|
||||||
@@ -13,12 +12,12 @@ MY_DOTFILE="$TEST_SOURCE/Dotfile"
|
|||||||
mkdir -p "$TEST_SOURCE" "$TEST_TARGET"
|
mkdir -p "$TEST_SOURCE" "$TEST_TARGET"
|
||||||
|
|
||||||
PROFILE_TXT="# I am a .profile file"
|
PROFILE_TXT="# I am a .profile file"
|
||||||
echo "$PROFILE_TXT" > "tmp/source/profile"
|
echo "$PROFILE_TXT" > "$TEST_SOURCE/profile"
|
||||||
|
|
||||||
# Basic of basics.
|
# Basic of basics.
|
||||||
echo -e "profile -> .profile" > "$MY_DOTFILE"
|
echo -e "profile -> .profile" > "$MY_DOTFILE"
|
||||||
assert_raises "../../bin/dotify -f '$MY_DOTFILE' -t '$TEST_TARGET'" 0
|
assert_raises "dotify -f '$MY_DOTFILE' -t '$TEST_TARGET'" 0
|
||||||
assert "../../bin/dotify -f '$MY_DOTFILE' -t '$TEST_TARGET'" \
|
assert "dotify -f '$MY_DOTFILE' -t '$TEST_TARGET'" \
|
||||||
" Create symlink: $TEST_TARGET/.profile -> .dotfiles/profile"
|
" Create symlink: $TEST_TARGET/.profile -> .dotfiles/profile"
|
||||||
assert "readlink '$TEST_TARGET/.profile'" ".dotfiles/profile"
|
assert "readlink '$TEST_TARGET/.profile'" ".dotfiles/profile"
|
||||||
assert "cat '$TEST_TARGET/.profile'" "$PROFILE_TXT"
|
assert "cat '$TEST_TARGET/.profile'" "$PROFILE_TXT"
|
||||||
@@ -27,7 +26,7 @@ rm "$MY_DOTFILE"
|
|||||||
|
|
||||||
|
|
||||||
# Remove temp files/folders used for locate-dotfile() tests.
|
# Remove temp files/folders used for locate-dotfile() tests.
|
||||||
rm "tmp/source/profile"
|
rm "$TEST_SOURCE/profile"
|
||||||
rmdir "tmp/source" "tmp/target" "tmp"
|
rmdir "$TEST_SOURCE" "$TEST_TARGET" "tmp"
|
||||||
|
|
||||||
assert_end 'Integration: link action'
|
assert_end 'Integration: link action'
|
||||||
|
|||||||
Reference in New Issue
Block a user