• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSObject -poseAs:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSObject -poseAs:


  • Subject: Re: NSObject -poseAs:
  • From: "Mike R. Manzano" <email@hidden>
  • Date: Fri, 1 Jun 2007 10:20:35 -0700


On May 31, 2007, at 5:43 PM, Jeff Laing wrote:


It seems to me that this is not a well-formed test case. If you "unpose",
are you expecting that a *new* singleton is going to be created, or that the
characteristics of the singleton will stop being your mock object and go
back to the original?



The latter.

In any case, I suspect (though I'm not sure) that you could add a category
in your test case that overwrites the defaultSomething message in the real
singleton class, to return your subclass.


ie,
@interface SingletonClass(TestingOnly)
+ (id)defaultSomething;		// overwrite base message handler
@end

Now make defaultSomething return an instance of your MockSingletonClass
which has appropriate gates built in, that can enable/disable itself based
on a boolean you can twiddle via some private method.

Well, duh :) Yes I think that would work perfectly. Thanks!

Mike
_______________________________________________

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:
This email sent to email@hidden


  • Prev by Date: Re: char Array to NSString to cString?
  • Next by Date: Re: open proxy setting
  • Previous by thread: NSTabViewItem Label binding
  • Next by thread: Re: open proxy setting
  • Index(es):
    • Date
    • Thread