Re: Solutions for "mocking" out NSUserDefaults?
Re: Solutions for "mocking" out NSUserDefaults?
- Subject: Re: Solutions for "mocking" out NSUserDefaults?
- From: Corbin Dunn <email@hidden>
- Date: Mon, 9 Jan 2006 17:20:45 -0800
Does anyone have any suggestions for imitating or acting like
NSUserDefaults transparently in tests? My last resort is to write a
class that will wrap NSUserDefaults and allow me to mock it out and
return what I want, but it seems a bit hackish.
Well, you probably simply want to change some values. I'd do one of
two things:
1. Simply write the values you want out to the userdefaults, even if
it is temporarily.
2. Pass them to the app, if you want different userdefaults each time
the app is ran. IE: "-MyUserDefaultName Value"
-corbin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden