File tree Expand file tree Collapse file tree 2 files changed +0
-29
lines changed Expand file tree Collapse file tree 2 files changed +0
-29
lines changed Original file line number Diff line number Diff line change 4
4
5
5
- Add multi-invokers; consolidate parameterized-testing documentation
6
6
- Add ` fail() ` function
7
- - Add ` unmock() ` function
8
7
- Remove all test mocks after each test case
9
8
10
9
## [ 0.11.0] ( https://github.com/TypedDevs/bashunit/compare/0.10.1...0.11.0 ) - 2024-03-02
Original file line number Diff line number Diff line change 41
41
```
42
42
:::
43
43
44
- ## unmock
45
-
46
- > ` unmock "function" `
47
-
48
- Undo the previous overridden behavior of a callable using mock.
49
-
50
- ::: code-group
51
- ``` bash [Example]
52
- function test_example() {
53
- function code() {
54
- ps a | grep bash
55
- }
56
-
57
- mock ps<< EOF
58
- PID TTY TIME CMD
59
- 13525 pts/7 00:00:01 bash
60
- 24162 pts/7 00:00:00 ps
61
- EOF
62
-
63
- # At this point, ps will return the mocked value above
64
- assert_equals " 13525 pts/7 00:00:01 bash" " $( code) "
65
-
66
- # From now on, ps will have the original behaviour again
67
- unmock ps
68
- }
69
- ```
70
- :::
71
-
72
44
## spy
73
45
> ` spy "function" `
74
46
You can’t perform that action at this time.
0 commit comments