Haven't dived into RSpec but is it not possible for expect to accept either args or blocks, and process them internally?
First off, expect
does accept either an arg or a block already. But if
it's a block (or a proc/lambda arg), expect
does not call the block
automatically -- it just passes the block to the matcher and allows the
matcher to call it if it wants. This is necessary because some matchers
(the block matchers like raise_error
, change
, etc) must wrap the
block in some extra logic to work properly because they deal in side
effects, not expression return values.