> BabyMock could not be treated as modern mock library just because it uses
> symbols instead of normal message sends. Even C# and Java mocks are based
> on normal messages.
Because they don't have symbols :).
Ruby libraries often use symbols, last
time I checked rspec mocks used it too. I think this is a matter of taste,
it's not about being modern or not.
protocol describe�� �� once: socket���� �� recv: #connectTo:port:waitForConnectionFor:
�� �� with: address with: port with: timeout.
socket stub connectTo: address port: port waitForConnectionFor: timeout.
I like thinking about mock objects as tools for describing inter-object
protocols (the visualisation tries to emphasize this aspect).
The
communication protocol between the object��
under test and its peers (mocks)
is expressed in a descriptive language (this language can be changed in
BabyMock quite easily). A narrator object (this is called Protocol in
BabyMock2) speaks in the third person to describe the message exchange
between the object cluster.
I don't like when expectations are set up in mocks directly any more,
neither the should/should have notation. The GOOS book was a big influence
on me at that time.