Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit 8f92084

Browse files
committed
added some first tests using SenTesting Framework
1 parent 9d8aebb commit 8f92084

File tree

9 files changed

+343
-46
lines changed

9 files changed

+343
-46
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
//
2+
// AppServiceData_Tests.m
3+
// DevEnvCtrl
4+
//
5+
// Created by Michael Nowak on 16.11.13.
6+
// Copyright (c) 2013 Michael Nowak. All rights reserved.
7+
//
8+
9+
#import <SenTestingKit/SenTestingKit.h>
10+
#import "AppServiceData.h"
11+
12+
@interface AppServiceData_Tests : SenTestCase
13+
{
14+
AppServiceData *subject;
15+
}
16+
@end
17+
18+
@implementation AppServiceData_Tests
19+
20+
- (void)setUp
21+
{
22+
[super setUp];
23+
// Put setup code here. This method is called before the invocation of each test method in the class.
24+
}
25+
26+
- (void)tearDown
27+
{
28+
// Put teardown code here. This method is called after the invocation of each test method in the class.
29+
[super tearDown];
30+
}
31+
32+
- (void)testExample
33+
{
34+
STAssertTrue(TRUE, @"WTF");
35+
}
36+
37+
- (void)testPlistPath
38+
{
39+
NSDictionary *dict;
40+
41+
dict = @{@"path": @"~/Library/LaunchAgents", @"job": @"com.example.foobar"};
42+
subject = [AppServiceData serviceDataWithDictionary:dict];
43+
STAssertEqualObjects([subject plistPath], [@"~/Library/LaunchAgents/com.example.foobar.plist" stringByExpandingTildeInPath],
44+
@"expcted to be build as expanded path + / + job + .plist");
45+
}
46+
47+
- (void)testContextUser
48+
{
49+
NSDictionary *dict;
50+
51+
dict = @{@"path": @"~/Library/LaunchAgents"};
52+
subject = [AppServiceData serviceDataWithDictionary:dict];
53+
STAssertTrue([subject contextUser],
54+
@"expected to be true for pathes starting with ~/");
55+
56+
dict = @{@"path": @"/Library/LaunchAgents"};
57+
subject = [AppServiceData serviceDataWithDictionary:dict];
58+
STAssertFalse([subject contextUser],
59+
@"expected to be false for pathes not starting with ~/");
60+
}
61+
62+
- (void)testContextRoot
63+
{
64+
NSDictionary *dict;
65+
66+
dict = @{@"path": @"~/Library/LaunchAgents"};
67+
subject = [AppServiceData serviceDataWithDictionary:dict];
68+
STAssertFalse([subject contextRoot],
69+
@"expected to be false for pathes starting with ~/");
70+
71+
dict = @{@"path": @"/Library/LaunchAgents"};
72+
subject = [AppServiceData serviceDataWithDictionary:dict];
73+
STAssertTrue([subject contextRoot],
74+
@"expected to be true for pathes not starting with ~/");
75+
}
76+
77+
@end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>${EXECUTABLE_NAME}</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>com.taktsoft.${PRODUCT_NAME:rfc1034identifier}</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundlePackageType</key>
14+
<string>BNDL</string>
15+
<key>CFBundleShortVersionString</key>
16+
<string>1.0</string>
17+
<key>CFBundleSignature</key>
18+
<string>????</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
</dict>
22+
</plist>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// Prefix header
3+
//
4+
// The contents of this file are implicitly included at the beginning of every source file.
5+
//
6+
7+
#ifdef __OBJC__
8+
#import <Cocoa/Cocoa.h>
9+
#endif

DevEnvCtrl Tests/DevEnvCtrl_Tests.m

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// DevEnvCtrl_Tests.m
3+
// DevEnvCtrl
4+
//
5+
// Created by Michael Nowak on 16.11.13.
6+
// Copyright (c) 2013 Michael Nowak. All rights reserved.
7+
//
8+
9+
#import <SenTestingKit/SenTestingKit.h>
10+
11+
@interface DevEnvCtrl_Tests : SenTestCase
12+
13+
@end
14+
15+
@implementation DevEnvCtrl_Tests
16+
17+
- (void)setUp
18+
{
19+
[super setUp];
20+
// Put setup code here. This method is called before the invocation of each test method in the class.
21+
}
22+
23+
- (void)tearDown
24+
{
25+
// Put teardown code here. This method is called after the invocation of each test method in the class.
26+
[super tearDown];
27+
}
28+
29+
- (void)testExample
30+
{
31+
STAssertTrue(TRUE, @"WTF");
32+
}
33+
34+
@end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* Localized versions of Info.plist keys */
2+

DevEnvCtrl.xcodeproj/project.pbxproj

Lines changed: 187 additions & 17 deletions
Large diffs are not rendered by default.

DevEnvCtrl/AppServiceDiskImage.h

Lines changed: 0 additions & 16 deletions
This file was deleted.

DevEnvCtrl/AppServiceDiskImage.m

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>label</key>
6+
<string>Memcached</string>
7+
<key>job</key>
8+
<string>homebrew.mxcl.memcached</string>
9+
<key>path</key>
10+
<string>~/Library/LaunchAgents</string>
11+
</dict>
12+
</plist>

0 commit comments

Comments
 (0)