Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSObject -poseAs:




On May 31, 2007, at 3:01 PM, Mike R. Manzano wrote:

On May 31, 2007, at 2:45 PM, Clark Cox wrote:

On 5/31/07, Mike R. Manzano <email@hidden> wrote:
[…]
How do you cancel a poseAs?

You don't.

Do you tell your posing object to pose as itself?

Perhaps posing as is the wrong solution for whatever you're trying to solve.

Perhaps. I have a unit test that is exercising a method that gets a singleton object from a factory. I was thinking it would be neat to create a mock factory that posed as the actual factory, so that when this method is exercised by the
unit test, the singleton it gets back is a mock singleton returned by the mock factory.


I've tested this, and it seems to work just fine. Problem is, it continues to happen past the execution of the test :)

I just need to unpose at the end of the unit test, but if you're telling me that isn't possible, then what a shame.

Can't you just set a static flag to indicate you're done, and just call [super ...] when the flag is on?


--
Jim Brownfield
email@hidden
Radical System Solutions, Inc.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >NSObject -poseAs: (From: "Mike R. Manzano" <email@hidden>)
 >Re: NSObject -poseAs: (From: "Clark Cox" <email@hidden>)
 >Re: NSObject -poseAs: (From: "Mike R. Manzano" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.