Skip to content

RSpock v2.2.0

Choose a tag to compare

@JPDuchesne JPDuchesne released this 25 Feb 22:32

New Feature

Return value stubbing with >> in interactions — Interactions in Then and Expect blocks now support the >> operator to stub return values. This lets you express expectations and stubs in a single, expressive statement:

1 * repository.find(42) >> { name: "item", status: "active" }
_ * cache.fetch("key") >> "cached_value"
(1..3) * service.call >> "result"

See README.md for full documentation.

Bug Fixes

  • Fix source mapping and backtrace referencing transformed files rather than source

Full Changelog: v2.1.0...v2.2.0