Permalink
Browse files

make mock registration fatal

This shouldn't ever happen since the mocks are defined by the calling
test framework. Failure should only occur when the function doesn't
exist, in which case it's an application error we don't want to try to
recover from.
  • Loading branch information...
1 parent 7e1fe58 commit 86a2b1a7ce2dba99735326f455c23f0d5c610990 @falconindy committed Dec 26, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 apron
View
5 apron
@@ -116,7 +116,10 @@ APRON_register() {
printf 'APRON: registering mock: %s\n' "$1"
fi
- APRON_defined_mocks["$1"]=$(declare -f "$1")
+ if ! APRON_defined_mocks["$1"]=$(declare -f "$1"); then
+ printf '==> FATAL: failed to register mock: %s\n' "$1"
+ exit 1
+ fi
export -f "$1"
}

0 comments on commit 86a2b1a

Please sign in to comment.