Re: [Pharo-users] [ANN] BabyMock 2

2014-04-24 Thread Attila Magyar
This looks like a slightly different problem to me, where something has a hardcoded, hidden dependency (a global class object), which is not substitutable by design, but we want to replace it from the test to something that answers the canned value. I understand the practical arguments that probab

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-24 Thread Sean P. DeNigris
Attila Magyar wrote > I made up an example because it makes easier to talk about this An easy example which comes up for me a lot is when I want to pretend it's a certain DateAndTime. I'd like DateAndTime now to return a canned value. I know all the theoretical arguments about how if I change my

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-24 Thread Attila Magyar
I made up an example because it makes easier to talk about this. Let's say, I want to test the #addAll: method of the OrderedCollection. If #addAll: is implemented as a loop that uses the #add: method (itemsToBeAdded do: [:each | self add: each]) then would you test the #addAll: isolated from the #

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-24 Thread Christophe Demarey
Le 23 avr. 2014 à 22:25, Attila Magyar a écrit : > Christophe Demarey wrote >> ... but sometimes, even in a well-designed class, you may need to test a >> very small part of this class, and in this case, you need a real object >> with some mocked methods. > > I assume that there is a method need

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-23 Thread Attila Magyar
Christophe Demarey wrote > ... but sometimes, even in a well-designed class, you may need to test a > very small part of this class, and in this case, you need a real object > with some mocked methods. I assume that there is a method need to be tested, but it calls towards an other either public o

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-23 Thread Christophe Demarey
Le 23 avr. 2014 à 15:37, Attila Magyar a écrit : > Hi Christophe, > > I'm not sure I fully understand, are you referring to partial mocking? Where > you have a real object but with some mocked methods? If this is the case, > then no, this is not supported. Some people consider this as a test sme

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-23 Thread Attila Magyar
Hi Christophe, I'm not sure I fully understand, are you referring to partial mocking? Where you have a real object but with some mocked methods? If this is the case, then no, this is not supported. Some people consider this as a test smell, and I agree with them. Maybe the object under test is too

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-23 Thread Christophe Demarey
Hi, Le 17 avr. 2014 à 19:22, Attila Magyar a écrit : > Hi Christophe, > > Sorry for my late response. You can use the following syntax to signal an > error in response to an incoming message: > > protocol describe >once: mock recv: #msg; >signals: Error. I did not notice this one. Than

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-17 Thread Attila Magyar
Hi Christophe, Sorry for my late response. You can use the following syntax to signal an error in response to an incoming message: protocol describe once: mock recv: #msg; signals: Error. Note that the Error is a class not an instance. Or alternatively you can execute an arbitrary block

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-09 Thread Christophe Demarey
Thanks Guillaume. It works well. With BabyMock2, the syntax is => aBlock Le 9 avr. 2014 à 11:13, Guillaume Larcheveque a écrit : > I think you can have your mock send an exception by using #answers:aBlock and > signal the exception in the block > > > 2014-04-08 15:58 GMT+02:00 Christophe Dem

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-09 Thread Guillaume Larcheveque
I think you can have your mock send an exception by using #answers:aBlock and signal the exception in the block 2014-04-08 15:58 GMT+02:00 Christophe Demarey : > Hello, > > Thanks. Very nice library! > > I have a question: is it possible to expect a method to throw an Exception? > > I would like

Re: [Pharo-users] [ANN] BabyMock 2

2014-04-08 Thread Christophe Demarey
Hello, Thanks. Very nice library! I have a question: is it possible to expect a method to throw an Exception? I would like something like: protocol describe once: mock recv: #aMethod ; signal: anError. I did not find anything in the documentation. I don't

Re: [Pharo-users] [ANN] BabyMock 2

2014-03-17 Thread Martin Dias
cool! On Wed, Mar 12, 2014 at 8:48 PM, Attila Magyar wrote: > Thanks for the nice words to everyone. > > > > -- > View this message in context: > http://forum.world.st/ANN-BabyMock-2-tp4748530p4748878.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. > >

Re: [Pharo-users] [ANN] BabyMock 2

2014-03-12 Thread Attila Magyar
Thanks for the nice words to everyone. -- View this message in context: http://forum.world.st/ANN-BabyMock-2-tp4748530p4748878.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Re: [Pharo-users] [ANN] BabyMock 2

2014-03-12 Thread Richard Wettel
Very cool stuff, indeed! Ricky On Wed, Mar 12, 2014 at 4:39 PM, Tudor Girba wrote: > Beautiful work! > > Doru > > > On Tue, Mar 11, 2014 at 12:30 PM, Attila Magyar wrote: > >> I'm pleased to announce the 2.0 version of BabyMock. BabyMock is a visual >> mock object library that supports test-dri

Re: [Pharo-users] [ANN] BabyMock 2

2014-03-12 Thread Tudor Girba
Beautiful work! Doru On Tue, Mar 11, 2014 at 12:30 PM, Attila Magyar wrote: > I'm pleased to announce the 2.0 version of BabyMock. BabyMock is a visual > mock object library that supports test-driven development. > > This version has a new syntax which is incompatible with the old version. > T

Re: [Pharo-users] [ANN] BabyMock 2

2014-03-11 Thread Benjamin
It looks even cooler than before :) Ben On 11 Mar 2014, at 12:30, Attila Magyar wrote: > I'm pleased to announce the 2.0 version of BabyMock. BabyMock is a visual > mock object library that supports test-driven development. > > This version has a new syntax which is incompatible with the old v

Re: [Pharo-users] [ANN] BabyMock 2

2014-03-11 Thread Guillaume Larcheveque
Cool!!! I use BabyMock a lot and I'm curious to see the new DSL. Thanks a lot for your work. 2014-03-11 12:30 GMT+01:00 Attila Magyar : > I'm pleased to announce the 2.0 version of BabyMock. BabyMock is a visual > mock object library that supports test-driven development. > > This version has a

[Pharo-users] [ANN] BabyMock 2

2014-03-11 Thread Attila Magyar
I'm pleased to announce the 2.0 version of BabyMock. BabyMock is a visual mock object library that supports test-driven development. This version has a new syntax which is incompatible with the old version. Therefore it has a new repository http://smalltalkhub.com/#!/~zeroflag/BabyMock2 (BabyMock