Skip to content

Commit

Permalink
- Upgrade approvals.bash library to version 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBen committed Aug 28, 2023
1 parent 6b2fd49 commit a68ad34
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/bashly/libraries/test/approvals.bash
@@ -1,4 +1,4 @@
# approvals.bash v0.3.3
# approvals.bash v0.4.0
#
# Interactive approval testing for Bash.
# https://github.com/DannyBen/approvals.bash
Expand All @@ -9,6 +9,10 @@ approve() {
cmd=$1
last_exit_code=0
actual=$(eval "$cmd" 2>&1) || last_exit_code=$?
if [[ "$allow_diff_regex" ]]; then
actual=$(echo "$actual" | sed "s/$allow_diff_regex/*/g")
unset allow_diff_regex
fi
approval=$(printf "%b" "$cmd" | tr -s -c "[:alnum:]" _)
approval_file="$approvals_dir/${2:-"$approval"}"

Expand All @@ -35,6 +39,10 @@ approve() {
fi
}

allow_diff() {
allow_diff_regex="$1"
}

describe() {
echo
blue "= $*"
Expand Down

0 comments on commit a68ad34

Please sign in to comment.