Skip to content

Commit 31f64a2

Browse files
committed
Improve fake robustness. Stop supporting Debian. Start supporting NixOS
1 parent f59dbfd commit 31f64a2

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

bash_unit

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
# https://github.com/pgrange/bash_unit
1818

19-
VERSION=v1.6.1
19+
VERSION=v1.7.0
2020

2121
ESCAPE=$(printf "\033")
2222
NOCOLOR="${ESCAPE}[0m"

docs/man/man1/bash_unit.1

+10-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: bash_unit
33
.\" Author: [see the "AUTHORS" section]
44
.\" Generator: Asciidoctor 1.5.5
5-
.\" Date: 2018-01-30
5+
.\" Date: 2020-01-18
66
.\" Manual: \ \&
77
.\" Source: \ \&
88
.\" Language: English
99
.\"
10-
.TH "BASH_UNIT" "1" "2018-01-30" "\ \&" "\ \&"
10+
.TH "BASH_UNIT" "1" "2020-01-18" "\ \&" "\ \&"
1111
.ie \n(.g .ds Aq \(aq
1212
.el .ds Aq '
1313
.ss \n[.ss] 0
@@ -725,7 +725,7 @@ bash \-c ps
725725
.RS 4
726726
.\}
727727
.nf
728-
bash: line 1: _ps: command not found
728+
environment: line 1: _ps: command not found
729729
.fi
730730
.if n \{\
731731
.RE
@@ -762,6 +762,13 @@ hello world
762762
\fBfake\fP is also limited by the fact that it defines a \fIbash\fP function to
763763
override the actual command. In some context the command can not be
764764
overriden by a function. For instance if your code under test relies on \fIexec\fP to launch \fIps\fP, \fBfake\fP will have no effect.
765+
.sp
766+
\fBfake\fP may also imply strange behaviors from bash_unit when you try to
767+
fake really basic stuff. bash_unit tries to be as much immune to this as
768+
possible but there are some limits. Especially and as surprising as it
769+
might seem, bash allows creating functions named after builtin commands
770+
and bash_unit won\(cqt resist that kind of situation. So, for instance, do
771+
not try to fake: \f[CR]exit\fP; \f[CR]local\fP; \f[CR]trap\fP; \f[CR]eval\fP; \f[CR]export\fP; \f[CR]if\fP; \f[CR]then\fP; \f[CR]else\fP; \f[CR]fi\fP; \f[CR]while\fP; \f[CR]do\fP; \f[CR]done\fP; \f[CR]$\fP; \f[CR]echo\fP; \f[CR][\fP (I know, this is not a builtin but don\(cqt).
765772
.SS "\fBfake\fP parameters"
766773
.sp
767774
\fBfake\fP stores parameters given to the fake in the global variable \fIFAKE_PARAMS\fP so that you can use them inside your fake.

0 commit comments

Comments
 (0)