We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
approvals.bash
1 parent 6b2fd49 commit a68ad34Copy full SHA for a68ad34
lib/bashly/libraries/test/approvals.bash
@@ -1,4 +1,4 @@
1
-# approvals.bash v0.3.3
+# approvals.bash v0.4.0
2
#
3
# Interactive approval testing for Bash.
4
# https://github.com/DannyBen/approvals.bash
@@ -9,6 +9,10 @@ approve() {
9
cmd=$1
10
last_exit_code=0
11
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
16
approval=$(printf "%b" "$cmd" | tr -s -c "[:alnum:]" _)
17
approval_file="$approvals_dir/${2:-"$approval"}"
18
@@ -35,6 +39,10 @@ approve() {
35
39
fi
36
40
}
37
41
42
+allow_diff() {
43
+ allow_diff_regex="$1"
44
+}
45
+
38
46
describe() {
47
echo
48
blue "= $*"
0 commit comments