1
#import <Foundation/Foundation.h>
2
#import "PreferencesTestCase.h"
3
#import "Preferences.h"
5
@implementation PreferencesTestCase : TestCase
9
NSUserDefaults *defaults;
12
defaults = [NSUserDefaults standardUserDefaults];
13
[defaults removePersistentDomainForName:@"Zipper"];
14
[defaults synchronize];
15
// also remove all replacement preferences that might have been set from previous test cases
16
[Preferences usePreferences:nil];
21
// setUp zaps all existing prefs
22
[self assertNil:[[NSUserDefaults standardUserDefaults] objectForKey:PREF_KEY_TAR]];
25
- (void)testFindInPath
29
// currently, all tests run in the same instance. This is unlike JUnit, however. In order
30
// to get this desired behaviour we call setUp here for now.
33
tar = [Preferences tarExecutable];
34
[self assert:tar equals:@"/bin/tar"];
37
- (void)testReplacementPrefs
42
// currently, all tests run in the same instance. This is unlike JUnit, however. In order
43
// to get this desired behaviour we call setUp here for now.
46
dummyTar = @"/foo/bar/baz/tar";
47
dict = [NSDictionary dictionaryWithObject:dummyTar forKey:PREF_KEY_TAR];
48
[Preferences usePreferences:dict];
50
[self assert:[Preferences tarExecutable] equals:dummyTar];
53
- (void)testPrefsFromPlist
55
// currently, all tests run in the same instance. This is unlike JUnit, however. In order
56
// to get this desired behaviour we call setUp here for now.
59
[self assert:[Preferences zipExecutable] equals:@"/plist/zip"];