On Wed, Mar 23, 2016 at 12:04 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:

2016-03-23 19:39 GMT+01:00 Eliot Miranda <eliot.miranda@gmail.com>:
This reads nicely.�� What is the class of the value answered by #should?�� What can you do with it?��

It returns ShouldExpression instance which wraps receiver to execute following messages. And following messages are supposed to execute some assertions under receiver.��
For example it can be "1 should be: 2". Or in case with block: "[1/0] should raise: ZeroDivide"

Personally I would rename ShouldExpression to ExecutedBlock or ExecutedExpression, keep #should as nice syntactic sugar, but provide #executed as the standard way of creating ExecutedExpressions.�� After all this is useful for more than SUnit.

��
And for message sends verification I tried to find something similar.
��
For example, assuming it is a record of the execution of the receiver, you could use

[mock someMessage. mock2 someMessage2] executed completely
[mock someMessage. mock2 someMessage2]��executed��completelyInOrder

and then #executed is meaningful, whereas #should is merely a linguistic hack.

And of course one could use #executes, but I think #executed is better; it has the sense of

[mock someMessage. mock2 someMessage2] when executed, #executes completely

_,,,^..^,,,_
best,��Eliot