Noam Ledany | 30 Jan 08:09

user@...

Hello,

I'm currently studying the jMock framework using your site.
I run into the following example ( about overrding expectations ) and it seems to me there is a mistake in the code:

<at> RunWith(JMock.class) public class ChildTest { Mockery context = new JUnit4Mockery(); States test = mockery.states("test"); Parent parent = context.mock(Parent.class); // This is created in setUp Child child; <at> Before public void createChildOfParent() { mockery.checking(new Expectations() {{ ignoring (parent).addChild(child); when(test.isNot("fully-set-up")); }}); // Creating the child adds it to the parent child = new Child(parent); test.become("fully-set-up"); } <at> Test public void removesItselfFromOldParentWhenAssignedNewParent() { Parent newParent = context.mock(Parent.class, "newParent"); context.checking(new Expectations() {{ oneOf (parent).removeChild(child); oneOf (newParent).addChild(child); }}); child.reparent(newParent); } }What is mockery  variable? Did you mean context and it's a misprint? or I'm getting it the wrong way?

Thanks,

Noam.



---------- Forwarded message ----------
From: <xircles-yCVjj/EcxBJg9hUCZPvPmw@public.gmane.org>
Date: Mon, Jan 30, 2012 at 8:52 AM
Subject: [Codehaus] Subscription confirmation for user-sXN/XchZ9OeVLWF/CSt7OA@public.gmane.org.org
To: noam <at> fashion-traffic.com


Hello noam <at> fashion-traffic.com

You have successfully subscribed to user-sXN/XchZ9OexIXFVlbCvtR2eb7JE58TQ@public.gmane.org using this email address.

Thanks,

Codehaus



Gmane