From 0e2b07d39f242ed22931365c63a87c4c055cc29f Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 1 Jul 2013 12:35:20 +0200 Subject: [PATCH] Fix a bug in test-helper.sh --- test/test-helper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test-helper.sh b/test/test-helper.sh index d3b153c..085f44a 100644 --- a/test/test-helper.sh +++ b/test/test-helper.sh @@ -29,13 +29,13 @@ stub() { # Restore the original command/function that was stubbed with stub. restore() { local cmd="$1" - unset "$cmd" + unset -f "$cmd" if type "original_${cmd}" &>/dev/null; then if [[ "$(type "original_${cmd}" | head -1)" == *"is a function" ]]; then local source="$(type "original_$cmd" | tail -n +2)" source="${source/original_${cmd}/$cmd}" eval "$source" - unset "original_${cmd}" + unset -f "original_${cmd}" fi fi }