Skip to content

Commit f63b2f7

Browse files
committed
docs: update mock usage typo
1 parent 28f24a6 commit f63b2f7

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
- Update docs mocks usage
56
- Add support for `.bash` test files
67

78
## [0.22.3](https://github.com/TypedDevs/bashunit/compare/0.22.2...0.22.3) - 2025-07-27

docs/test-doubles.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,24 @@ function test_example() {
2222
```
2323
:::
2424

25-
> `mock "function" "output"`
25+
> `mock "function" <<< "output"`
2626
27-
Allows you to override the output of a callable.
27+
Allows you to override the output of a callable. When the mocked output fits on
28+
a single line you can use a here-string:
29+
30+
```bash
31+
mock uname <<< "Linux"
32+
```
33+
34+
For multi-line output rely on a here-document:
35+
36+
```bash
37+
mock ps <<EOF
38+
PID TTY TIME CMD
39+
13525 pts/7 00:00:01 bash
40+
24162 pts/7 00:00:00 ps
41+
EOF
42+
```
2843

2944
::: code-group
3045
```bash [Example]

0 commit comments

Comments
 (0)