Open pirj opened 2 months ago
I think I'd rather eq
supported both block and value type of expectations e.g.
$bar=0
expect { foo }
.to change { $bar }.to(1)
.and eq(2)
Maybe satisfy
without/with a block?
That would allow passing composed matchers:
$bar=0
expect { foo }
.to change { $bar }.to(1)
.and satisfy(eq(2))
$bar=0
expect { foo }
.to change { $bar }.to(1)
.and satisfy { |baz| baz == 2 }
I have a proof of concept of a matcher that works with block expectations, but checks the value returned by the block. Works as a compound matcher, too:
Existing known alternatives:
PS it took me five years
Is this something worth continuing working on, WDYT @JonRowe ?