On 2009-01-19 04:31, "Michael McCracken" <michael.mccrac...@gmail.com> wrote:
> On Sun, Jan 18, 2009 at 8:58 PM, Gregory Jefferis <jeffe...@gmail.com> wrote: >> >> On 2009-01-19 01:42, "Christiaan Hofman" <cmhof...@gmail.com> wrote: >> >>> >>> On 19 Jan 2009, at 2:20 AM, Gregory Jefferis wrote: >>> >>>> On 2009-01-19 00:39, "Adam R. Maxwell" <amaxw...@mac.com> wrote: >>>> >>> I don't think that's possible, but I don't know too much about unit >>> tests. I'd rather say that the tests should be designed to be >>> independent of the prefs. >> Yes and no. I think that there could be sensible reasons to want to test >> the effect of a preference on program behaviour. > > This is possible- you can remove the application domain prefs (the > ones the user sets) from NSUserDefaults: > [[NSUserDefaults standardUserDefaults] > removePersistentDomainForName:@"edu.ucsd.cs.mmccrack.bibdesk"] > > this is probably a good idea to do - so the tests are always testing > the same thing, and if we need to test the effects of a pref, you just > set it in the test. Hmm, it turns out that clears all user defaults from the preferences file - ie it hoses ~/Library/Preferences/edu.ucsd.cs.mmccrack.bibdesk.plist ! So it 'works' ... permanently. Any further suggestions? I'm finding the NSUserDefaults docs a bit opaque. > > Thanks for sticking with this. > Adding tests to existing code is a multi-step process, but I'm sure > they're going to be very useful. > ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Bibdesk-develop mailing list Bibdesk-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-develop