Hi all,

I am quite new to smalltalk and I am probably having "cultural"
difficulties. I mostly work with Java.
So it is possible that there is trivial answer for my question or my
question is just wrong. But here
it goes.

I am implementing object that should make a call to some other object.
I need to test that the
caller works correctly based on the return value it receives. So
basically the code and the test
looks like this and I need to fill the XXXX part:

Object>>doSomething
    result:=innerObject makeACall.
    "based on result do something"

Test>>test
    "get bogus object for testing from somewhere"
    mockForTest := XXXX.
    (Object new)
        innerObject: mockForTest.
        doSomething.
    "check that something was done."

I am used to resolve this kind of problems using mock objects. I
tought it would be easy to implement
in smalltalk too because it is dynamic language. However with my limited
searches I did not found much usable code or examples how to do it.
So, my question is: is there some easy way to resolve this problem or
does it require
a bigger library? If it does, is there a library already for that?

-- 
Panu

_______________________________________________
Pharo-users mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users

Reply via email to