Skip to content

Commit e6c4ec3

Browse files
committed
Add release notes.
1 parent b133d40 commit e6c4ec3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

releases.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Releases
22

3+
## Unreleased
4+
5+
### `receive` now supports blocks and `and_raise`.
6+
7+
The `receive` predicate has been enhanced to support blocks and the `and_raise` method, allowing for more flexible mocking of method calls.
8+
9+
```ruby
10+
# `receive` with a block:
11+
expect(interface).to receive(:implementation) {10}
12+
13+
# `and_return` with a block:
14+
expect(interface).to receive(:implementation).and_return{FakeImplementation.new}
15+
16+
# `and_raise` for error handling:
17+
expect(interface).to receive(:implementation).and_raise(StandardError, "An error occurred")
18+
```
19+
320
## v0.32.0
421

522
- `Sus::Config` now has a `prepare_warnings!` hook which enables deprecated warnings by default. This is generally considered good behaviour for a test framework.

0 commit comments

Comments
 (0)