Skip to content

Commit 3c2c6d2

Browse files
committed
Document raising errors
1 parent b07fab0 commit 3c2c6d2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ mocked_object.foo:should_be_called():when(function()
5757
end)
5858
```
5959

60+
## Raising Errors with Mocks
61+
62+
```lua
63+
local mach = require 'mach'
64+
65+
local f = mach.mock_function('f')
66+
67+
f:should_be_called():and_will_raise_error('some error'):when(function()
68+
f()
69+
end)
70+
```
71+
6072
## Multiple Expectations
6173

6274
```lua

0 commit comments

Comments
 (0)