Skip to content

Commit a68ad34

Browse files
committed
- Upgrade approvals.bash library to version 0.4.0
1 parent 6b2fd49 commit a68ad34

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/bashly/libraries/test/approvals.bash

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# approvals.bash v0.3.3
1+
# approvals.bash v0.4.0
22
#
33
# Interactive approval testing for Bash.
44
# https://github.com/DannyBen/approvals.bash
@@ -9,6 +9,10 @@ approve() {
99
cmd=$1
1010
last_exit_code=0
1111
actual=$(eval "$cmd" 2>&1) || last_exit_code=$?
12+
if [[ "$allow_diff_regex" ]]; then
13+
actual=$(echo "$actual" | sed "s/$allow_diff_regex/*/g")
14+
unset allow_diff_regex
15+
fi
1216
approval=$(printf "%b" "$cmd" | tr -s -c "[:alnum:]" _)
1317
approval_file="$approvals_dir/${2:-"$approval"}"
1418

@@ -35,6 +39,10 @@ approve() {
3539
fi
3640
}
3741

42+
allow_diff() {
43+
allow_diff_regex="$1"
44+
}
45+
3846
describe() {
3947
echo
4048
blue "= $*"

0 commit comments

Comments
 (0)