Simplest mock objects DSL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Simplest mock objects DSL

Denis Kudriashov
Hi, all

I released new version of new mock objects framework BehaviorMockup (http://www.squeaksource.com/BehaviorMockup or cincom public repository).

Just see very simplest syntax:

[:mockA :mockB |
mockA someMessage.
mockB someMessage2]
    should strictly satisfy:
[:mockB :mockA :mockC|
mockA someMessage willReturn: 'some result'.
mockB someMessage2 willReturn: mockC].

First block is tested behavior. Its args is required mock objects for this behavior.
Second block is behavior specification. Its args is all mock objects which are needed for modelling real objects behavior.
Args in first block must have names which are equal for second block args. In debugger mock objects will have same names.

Best regards.
Denis