iCuke 0.5.5 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/.gitmodules +3 -0
- data/README.rdoc +8 -7
- data/Rakefile +10 -30
- data/VERSION +1 -1
- data/app/.gitignore +3 -0
- data/app/LICENSE +20 -0
- data/app/Readme.markdown +3 -0
- data/app/Shared/AppDelegate_Shared.h +17 -0
- data/app/Shared/AppDelegate_Shared.m +25 -0
- data/app/{images/yellowslide.png → Shared/Icon.png} +0 -0
- data/app/Shared/ModalViewController.h +15 -0
- data/app/Shared/ModalViewController.m +96 -0
- data/app/Shared/TestViewController_Shared.h +15 -0
- data/app/Shared/TestViewController_Shared.m +43 -0
- data/app/{Info.plist → Shared/Universal-Info.plist} +17 -4
- data/app/Shared/Universal_Prefix.pch +8 -0
- data/app/Shared/main.m +14 -0
- data/app/Universal.xcodeproj/project.pbxproj +301 -0
- data/app/iPad/AppDelegate_Pad.h +15 -0
- data/app/iPad/AppDelegate_Pad.m +28 -0
- data/app/iPad/Default-Landscape.png +0 -0
- data/app/iPad/Default-Portrait.png +0 -0
- data/app/iPad/MainWindow_Pad.xib +343 -0
- data/app/iPad/TestViewController_Pad.h +15 -0
- data/app/iPad/TestViewController_Pad.m +52 -0
- data/app/iPhone/AppDelegate_Phone.h +15 -0
- data/app/iPhone/AppDelegate_Phone.m +28 -0
- data/app/{images/segment_search.png → iPhone/Default.png} +0 -0
- data/app/iPhone/MainWindow_Phone.xib +363 -0
- data/app/iPhone/TestViewController_Phone.h +15 -0
- data/app/iPhone/TestViewController_Phone.m +36 -0
- data/bin/.gitignore +1 -0
- data/bin/icuke +10 -0
- data/bin/icuke-module +17 -0
- data/ext/.gitignore +1 -0
- data/ext/Rakefile +6 -0
- data/ext/WaxSim/Simulator.h +31 -0
- data/ext/WaxSim/Simulator.m +131 -0
- data/ext/WaxSim/WaxSim.m +110 -0
- data/ext/WaxSim/WaxSim.xcodeproj/project.pbxproj +238 -0
- data/ext/WaxSim/WaxSim_Prefix.pch +7 -0
- data/ext/WaxSim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h +126 -0
- data/ext/iCuke/Rakefile +14 -17
- data/ext/iCuke/libicuke-sdk3.1.dylib +0 -0
- data/ext/iCuke/libicuke-sdk4.0.dylib +0 -0
- data/ext/iCuke/libicuke.dylib +0 -0
- data/ext/iCuke/{DefaultsResponse.h → sdk3.1/DefaultsResponse.h} +0 -0
- data/ext/iCuke/{DefaultsResponse.m → sdk3.1/DefaultsResponse.m} +0 -0
- data/ext/iCuke/{EventResponse.h → sdk3.1/EventResponse.h} +0 -0
- data/ext/iCuke/{EventResponse.m → sdk3.1/EventResponse.m} +0 -0
- data/ext/iCuke/sdk3.1/ModuleResponse.h +5 -0
- data/ext/iCuke/sdk3.1/ModuleResponse.m +76 -0
- data/ext/iCuke/sdk3.1/Rakefile +20 -0
- data/ext/iCuke/{Recorder.h → sdk3.1/Recorder.h} +0 -0
- data/ext/iCuke/{Recorder.m → sdk3.1/Recorder.m} +0 -0
- data/ext/iCuke/{RecorderResponse.h → sdk3.1/RecorderResponse.h} +0 -0
- data/ext/iCuke/{RecorderResponse.m → sdk3.1/RecorderResponse.m} +0 -0
- data/ext/iCuke/{SynthesizeSingleton.h → sdk3.1/SynthesizeSingleton.h} +0 -0
- data/ext/iCuke/{ViewResponse.h → sdk3.1/ViewResponse.h} +0 -0
- data/ext/iCuke/{ViewResponse.m → sdk3.1/ViewResponse.m} +0 -0
- data/ext/iCuke/{Viewer.h → sdk3.1/Viewer.h} +0 -0
- data/ext/iCuke/sdk3.1/Viewer.m +203 -0
- data/ext/iCuke/{iCukeHTTPResponseHandler.h → sdk3.1/iCukeHTTPResponseHandler.h} +0 -0
- data/ext/iCuke/{iCukeHTTPResponseHandler.m → sdk3.1/iCukeHTTPResponseHandler.m} +0 -0
- data/ext/iCuke/{iCukeHTTPServer.h → sdk3.1/iCukeHTTPServer.h} +0 -0
- data/ext/iCuke/{iCukeHTTPServer.m → sdk3.1/iCukeHTTPServer.m} +0 -0
- data/ext/iCuke/{iCukeServer.h → sdk3.1/iCukeServer.h} +0 -2
- data/ext/iCuke/{iCukeServer.m → sdk3.1/iCukeServer.m} +22 -20
- data/ext/iCuke/{json → sdk3.1/json}/JSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJSON.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.m +0 -0
- data/ext/iCuke/sdk4.0/DefaultsResponse.h +5 -0
- data/ext/iCuke/sdk4.0/DefaultsResponse.m +66 -0
- data/ext/iCuke/sdk4.0/EventResponse.h +5 -0
- data/ext/iCuke/sdk4.0/EventResponse.m +130 -0
- data/ext/iCuke/sdk4.0/ModuleResponse.h +5 -0
- data/ext/iCuke/sdk4.0/ModuleResponse.m +76 -0
- data/ext/iCuke/sdk4.0/Rakefile +20 -0
- data/ext/iCuke/sdk4.0/Recorder.h +17 -0
- data/ext/iCuke/sdk4.0/Recorder.m +90 -0
- data/ext/iCuke/sdk4.0/RecorderResponse.h +6 -0
- data/ext/iCuke/sdk4.0/RecorderResponse.m +68 -0
- data/ext/iCuke/sdk4.0/SynthesizeSingleton.h +68 -0
- data/ext/iCuke/sdk4.0/ViewResponse.h +5 -0
- data/ext/iCuke/sdk4.0/ViewResponse.m +84 -0
- data/ext/iCuke/sdk4.0/Viewer.h +8 -0
- data/ext/iCuke/{Viewer.m → sdk4.0/Viewer.m} +14 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.h +50 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.m +381 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPServer.h +53 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPServer.m +365 -0
- data/ext/iCuke/sdk4.0/iCukeServer.h +14 -0
- data/ext/iCuke/sdk4.0/iCukeServer.m +65 -0
- data/ext/iCuke/sdk4.0/json/JSON.h +50 -0
- data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.h +68 -0
- data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.m +53 -0
- data/ext/iCuke/sdk4.0/json/NSString+SBJSON.h +58 -0
- data/ext/iCuke/sdk4.0/json/NSString+SBJSON.m +55 -0
- data/ext/iCuke/sdk4.0/json/SBJSON.h +75 -0
- data/ext/iCuke/sdk4.0/json/SBJSON.m +212 -0
- data/ext/iCuke/sdk4.0/json/SBJsonBase.h +86 -0
- data/ext/iCuke/sdk4.0/json/SBJsonBase.m +78 -0
- data/ext/iCuke/sdk4.0/json/SBJsonParser.h +87 -0
- data/ext/iCuke/sdk4.0/json/SBJsonParser.m +475 -0
- data/ext/iCuke/sdk4.0/json/SBJsonWriter.h +129 -0
- data/ext/iCuke/sdk4.0/json/SBJsonWriter.m +228 -0
- data/features/iphone.feature +15 -0
- data/features/support/env.rb +1 -1
- data/iCuke.gemspec +118 -114
- data/lib/icuke/cucumber.rb +93 -64
- data/lib/icuke/screen.rb +110 -0
- data/lib/icuke/sdk.rb +134 -0
- data/lib/icuke/simulate.rb +9 -5
- data/lib/icuke/simulator.rb +10 -11
- data/lib/icuke/waxsim.rb +36 -0
- data/lib/icuke.rb +2 -1
- metadata +124 -129
- data/app/AlertsViewController.h +0 -59
- data/app/AlertsViewController.m +0 -341
- data/app/AppDelegate.h +0 -60
- data/app/AppDelegate.m +0 -101
- data/app/ButtonsViewController.h +0 -80
- data/app/ButtonsViewController.m +0 -448
- data/app/Constants.h +0 -58
- data/app/ControlsViewController.h +0 -72
- data/app/ControlsViewController.m +0 -379
- data/app/ImagesViewController.h +0 -62
- data/app/ImagesViewController.m +0 -137
- data/app/MainViewController.h +0 -57
- data/app/MainViewController.m +0 -262
- data/app/Picker/CustomPickerDataSource.h +0 -55
- data/app/Picker/CustomPickerDataSource.m +0 -135
- data/app/Picker/CustomView.h +0 -62
- data/app/Picker/CustomView.m +0 -119
- data/app/PickerViewController.h +0 -88
- data/app/PickerViewController.m +0 -402
- data/app/Prefix.pch +0 -5
- data/app/ReadMe.txt +0 -82
- data/app/SearchBarController.h +0 -58
- data/app/SearchBarController.m +0 -105
- data/app/SegmentViewController.h +0 -54
- data/app/SegmentViewController.m +0 -195
- data/app/TextFieldController.h +0 -67
- data/app/TextFieldController.m +0 -342
- data/app/TextViewController.h +0 -57
- data/app/TextViewController.m +0 -164
- data/app/ToolbarViewController.h +0 -74
- data/app/ToolbarViewController.m +0 -303
- data/app/TransitionViewController.h +0 -64
- data/app/TransitionViewController.m +0 -178
- data/app/UICatalog.xcodeproj/project.pbxproj +0 -615
- data/app/WebViewController.h +0 -57
- data/app/WebViewController.m +0 -173
- data/app/en.lproj/AlertsViewController.xib +0 -144
- data/app/en.lproj/ButtonsViewController.xib +0 -147
- data/app/en.lproj/ControlsViewController.xib +0 -147
- data/app/en.lproj/ImagesViewController.xib +0 -264
- data/app/en.lproj/Localizable.strings +0 -41
- data/app/en.lproj/MainWindow.xib +0 -306
- data/app/en.lproj/PickerViewController.xib +0 -415
- data/app/en.lproj/SearchBarController.xib +0 -142
- data/app/en.lproj/SegmentViewController.xib +0 -143
- data/app/en.lproj/TextFieldController.xib +0 -167
- data/app/en.lproj/TextViewController.xib +0 -149
- data/app/en.lproj/ToolbarViewController.xib +0 -491
- data/app/en.lproj/TransitionViewController.xib +0 -255
- data/app/en.lproj/WebViewController.xib +0 -141
- data/app/images/12-6AM.png +0 -0
- data/app/images/12-6PM.png +0 -0
- data/app/images/6-12AM.png +0 -0
- data/app/images/6-12PM.png +0 -0
- data/app/images/Default.png +0 -0
- data/app/images/Icon.png +0 -0
- data/app/images/UIButton_custom.png +0 -0
- data/app/images/blueButton.png +0 -0
- data/app/images/orangeslide.png +0 -0
- data/app/images/scene1.jpg +0 -0
- data/app/images/scene2.jpg +0 -0
- data/app/images/scene3.jpg +0 -0
- data/app/images/scene4.jpg +0 -0
- data/app/images/scene5.jpg +0 -0
- data/app/images/segment_check.png +0 -0
- data/app/images/segment_tools.png +0 -0
- data/app/images/slider_ball.png +0 -0
- data/app/images/whiteButton.png +0 -0
- data/app/main.m +0 -58
- data/features/uicatalog.feature +0 -20
- data/lib/icuke/com.apple.Accessibility.plist +0 -0
- data/lib/icuke/headless.rb +0 -54
- data/lib/icuke/xcode.rb +0 -164
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2009 Stig Brautaset. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
* Neither the name of the author nor the names of its contributors may be used
|
|
15
|
+
to endorse or promote products derived from this software without specific
|
|
16
|
+
prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
22
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
23
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
24
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
25
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
26
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#import "SBJsonWriter.h"
|
|
31
|
+
|
|
32
|
+
@interface SBJsonWriter ()
|
|
33
|
+
|
|
34
|
+
- (BOOL)appendValue:(id)fragment into:(NSMutableString*)json;
|
|
35
|
+
- (BOOL)appendArray:(NSArray*)fragment into:(NSMutableString*)json;
|
|
36
|
+
- (BOOL)appendDictionary:(NSDictionary*)fragment into:(NSMutableString*)json;
|
|
37
|
+
- (BOOL)appendString:(NSString*)fragment into:(NSMutableString*)json;
|
|
38
|
+
|
|
39
|
+
- (NSString*)indent;
|
|
40
|
+
|
|
41
|
+
@end
|
|
42
|
+
|
|
43
|
+
@implementation SBJsonWriter
|
|
44
|
+
|
|
45
|
+
@synthesize sortKeys;
|
|
46
|
+
@synthesize humanReadable;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
@deprecated This exists in order to provide fragment support in older APIs in one more version.
|
|
50
|
+
It should be removed in the next major version.
|
|
51
|
+
*/
|
|
52
|
+
- (NSString*)stringWithFragment:(id)value {
|
|
53
|
+
[self clearErrorTrace];
|
|
54
|
+
depth = 0;
|
|
55
|
+
NSMutableString *json = [NSMutableString stringWithCapacity:128];
|
|
56
|
+
|
|
57
|
+
if ([self appendValue:value into:json])
|
|
58
|
+
return json;
|
|
59
|
+
|
|
60
|
+
return nil;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
- (NSString*)stringWithObject:(id)value {
|
|
65
|
+
|
|
66
|
+
if ([value isKindOfClass:[NSDictionary class]] || [value isKindOfClass:[NSArray class]]) {
|
|
67
|
+
return [self stringWithFragment:value];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
[self clearErrorTrace];
|
|
71
|
+
[self addErrorWithCode:EFRAGMENT description:@"Not valid type for JSON"];
|
|
72
|
+
return nil;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
- (NSString*)indent {
|
|
77
|
+
return [@"\n" stringByPaddingToLength:1 + 2 * depth withString:@" " startingAtIndex:0];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
- (BOOL)appendValue:(id)fragment into:(NSMutableString*)json {
|
|
81
|
+
if ([fragment isKindOfClass:[NSDictionary class]]) {
|
|
82
|
+
if (![self appendDictionary:fragment into:json])
|
|
83
|
+
return NO;
|
|
84
|
+
|
|
85
|
+
} else if ([fragment isKindOfClass:[NSArray class]]) {
|
|
86
|
+
if (![self appendArray:fragment into:json])
|
|
87
|
+
return NO;
|
|
88
|
+
|
|
89
|
+
} else if ([fragment isKindOfClass:[NSString class]]) {
|
|
90
|
+
if (![self appendString:fragment into:json])
|
|
91
|
+
return NO;
|
|
92
|
+
|
|
93
|
+
} else if ([fragment isKindOfClass:[NSNumber class]]) {
|
|
94
|
+
if ('c' == *[fragment objCType])
|
|
95
|
+
[json appendString:[fragment boolValue] ? @"true" : @"false"];
|
|
96
|
+
else
|
|
97
|
+
[json appendString:[fragment stringValue]];
|
|
98
|
+
|
|
99
|
+
} else if ([fragment isKindOfClass:[NSNull class]]) {
|
|
100
|
+
[json appendString:@"null"];
|
|
101
|
+
} else if ([fragment respondsToSelector:@selector(proxyForJson)]) {
|
|
102
|
+
[self appendValue:[fragment proxyForJson] into:json];
|
|
103
|
+
|
|
104
|
+
} else {
|
|
105
|
+
[self addErrorWithCode:EUNSUPPORTED description:[NSString stringWithFormat:@"JSON serialisation not supported for %@", [fragment class]]];
|
|
106
|
+
return NO;
|
|
107
|
+
}
|
|
108
|
+
return YES;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
- (BOOL)appendArray:(NSArray*)fragment into:(NSMutableString*)json {
|
|
112
|
+
if (maxDepth && ++depth > maxDepth) {
|
|
113
|
+
[self addErrorWithCode:EDEPTH description: @"Nested too deep"];
|
|
114
|
+
return NO;
|
|
115
|
+
}
|
|
116
|
+
[json appendString:@"["];
|
|
117
|
+
|
|
118
|
+
BOOL addComma = NO;
|
|
119
|
+
for (id value in fragment) {
|
|
120
|
+
if (addComma)
|
|
121
|
+
[json appendString:@","];
|
|
122
|
+
else
|
|
123
|
+
addComma = YES;
|
|
124
|
+
|
|
125
|
+
if ([self humanReadable])
|
|
126
|
+
[json appendString:[self indent]];
|
|
127
|
+
|
|
128
|
+
if (![self appendValue:value into:json]) {
|
|
129
|
+
return NO;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
depth--;
|
|
134
|
+
if ([self humanReadable] && [fragment count])
|
|
135
|
+
[json appendString:[self indent]];
|
|
136
|
+
[json appendString:@"]"];
|
|
137
|
+
return YES;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
- (BOOL)appendDictionary:(NSDictionary*)fragment into:(NSMutableString*)json {
|
|
141
|
+
if (maxDepth && ++depth > maxDepth) {
|
|
142
|
+
[self addErrorWithCode:EDEPTH description: @"Nested too deep"];
|
|
143
|
+
return NO;
|
|
144
|
+
}
|
|
145
|
+
[json appendString:@"{"];
|
|
146
|
+
|
|
147
|
+
NSString *colon = [self humanReadable] ? @" : " : @":";
|
|
148
|
+
BOOL addComma = NO;
|
|
149
|
+
NSArray *keys = [fragment allKeys];
|
|
150
|
+
if (self.sortKeys)
|
|
151
|
+
keys = [keys sortedArrayUsingSelector:@selector(compare:)];
|
|
152
|
+
|
|
153
|
+
for (id value in keys) {
|
|
154
|
+
if (addComma)
|
|
155
|
+
[json appendString:@","];
|
|
156
|
+
else
|
|
157
|
+
addComma = YES;
|
|
158
|
+
|
|
159
|
+
if ([self humanReadable])
|
|
160
|
+
[json appendString:[self indent]];
|
|
161
|
+
|
|
162
|
+
if (![value isKindOfClass:[NSString class]]) {
|
|
163
|
+
[self addErrorWithCode:EUNSUPPORTED description: @"JSON object key must be string"];
|
|
164
|
+
return NO;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (![self appendString:value into:json])
|
|
168
|
+
return NO;
|
|
169
|
+
|
|
170
|
+
[json appendString:colon];
|
|
171
|
+
if (![self appendValue:[fragment objectForKey:value] into:json]) {
|
|
172
|
+
[self addErrorWithCode:EUNSUPPORTED description:[NSString stringWithFormat:@"Unsupported value for key %@ in object", value]];
|
|
173
|
+
return NO;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
depth--;
|
|
178
|
+
if ([self humanReadable] && [fragment count])
|
|
179
|
+
[json appendString:[self indent]];
|
|
180
|
+
[json appendString:@"}"];
|
|
181
|
+
return YES;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
- (BOOL)appendString:(NSString*)fragment into:(NSMutableString*)json {
|
|
185
|
+
|
|
186
|
+
static NSMutableCharacterSet *kEscapeChars;
|
|
187
|
+
if( ! kEscapeChars ) {
|
|
188
|
+
kEscapeChars = [[NSMutableCharacterSet characterSetWithRange: NSMakeRange(0,32)] retain];
|
|
189
|
+
[kEscapeChars addCharactersInString: @"\"\\"];
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
[json appendString:@"\""];
|
|
193
|
+
|
|
194
|
+
NSRange esc = [fragment rangeOfCharacterFromSet:kEscapeChars];
|
|
195
|
+
if ( !esc.length ) {
|
|
196
|
+
// No special chars -- can just add the raw string:
|
|
197
|
+
[json appendString:fragment];
|
|
198
|
+
|
|
199
|
+
} else {
|
|
200
|
+
NSUInteger length = [fragment length];
|
|
201
|
+
for (NSUInteger i = 0; i < length; i++) {
|
|
202
|
+
unichar uc = [fragment characterAtIndex:i];
|
|
203
|
+
switch (uc) {
|
|
204
|
+
case '"': [json appendString:@"\\\""]; break;
|
|
205
|
+
case '\\': [json appendString:@"\\\\"]; break;
|
|
206
|
+
case '\t': [json appendString:@"\\t"]; break;
|
|
207
|
+
case '\n': [json appendString:@"\\n"]; break;
|
|
208
|
+
case '\r': [json appendString:@"\\r"]; break;
|
|
209
|
+
case '\b': [json appendString:@"\\b"]; break;
|
|
210
|
+
case '\f': [json appendString:@"\\f"]; break;
|
|
211
|
+
default:
|
|
212
|
+
if (uc < 0x20) {
|
|
213
|
+
[json appendFormat:@"\\u%04x", uc];
|
|
214
|
+
} else {
|
|
215
|
+
CFStringAppendCharacters((CFMutableStringRef)json, &uc, 1);
|
|
216
|
+
}
|
|
217
|
+
break;
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
[json appendString:@"\""];
|
|
224
|
+
return YES;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
@end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Feature: iPhone integration tests
|
|
2
|
+
In order to test my iphone application
|
|
3
|
+
As a developer
|
|
4
|
+
I want cucumber to be able to drive the simulator
|
|
5
|
+
|
|
6
|
+
Background:
|
|
7
|
+
Given "app/Universal.xcodeproj" is loaded in the iphone simulator
|
|
8
|
+
|
|
9
|
+
Scenario: Scrolling
|
|
10
|
+
When I tap "Show Test Modal"
|
|
11
|
+
Then I should see "Lorem ipsum dolor"
|
|
12
|
+
But I should not see "Fusce sem nisi"
|
|
13
|
+
When I scroll down to "Fusce sem nisi"
|
|
14
|
+
Then I should see "Fusce sem nisi"
|
|
15
|
+
But I should not see "Lorem ipsum dolor"
|
data/features/support/env.rb
CHANGED
data/iCuke.gemspec
CHANGED
|
@@ -5,144 +5,151 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{iCuke}
|
|
8
|
-
s.version = "0.
|
|
8
|
+
s.version = "0.6.0"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Rob Holland"]
|
|
12
|
-
s.date = %q{2010-06-
|
|
12
|
+
s.date = %q{2010-06-25}
|
|
13
13
|
s.description = %q{Cucumber support for iPhone applications}
|
|
14
14
|
s.email = %q{rob@the-it-refinery.co.uk}
|
|
15
|
-
s.
|
|
15
|
+
s.executables = ["icuke", "icuke-module"]
|
|
16
|
+
s.extensions = ["ext/Rakefile"]
|
|
16
17
|
s.extra_rdoc_files = [
|
|
17
18
|
"LICENSE",
|
|
18
19
|
"README.rdoc"
|
|
19
20
|
]
|
|
20
21
|
s.files = [
|
|
21
22
|
".gitignore",
|
|
23
|
+
".gitmodules",
|
|
22
24
|
"History.txt",
|
|
23
25
|
"LICENSE",
|
|
24
26
|
"README.rdoc",
|
|
25
27
|
"Rakefile",
|
|
26
28
|
"VERSION",
|
|
27
29
|
"app/.gitignore",
|
|
28
|
-
"app/
|
|
29
|
-
"app/
|
|
30
|
-
"app/
|
|
31
|
-
"app/
|
|
32
|
-
"app/
|
|
33
|
-
"app/
|
|
34
|
-
"app/
|
|
35
|
-
"app/
|
|
36
|
-
"app/
|
|
37
|
-
"app/
|
|
38
|
-
"app/
|
|
39
|
-
"app/
|
|
40
|
-
"app/
|
|
41
|
-
"app/
|
|
42
|
-
"app/
|
|
43
|
-
"app/
|
|
44
|
-
"app/
|
|
45
|
-
"app/
|
|
46
|
-
"app/
|
|
47
|
-
"app/
|
|
48
|
-
"app/
|
|
49
|
-
"app/
|
|
50
|
-
"app/
|
|
51
|
-
"app/
|
|
52
|
-
"app/
|
|
53
|
-
"app/
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"app/en.lproj/AlertsViewController.xib",
|
|
66
|
-
"app/en.lproj/ButtonsViewController.xib",
|
|
67
|
-
"app/en.lproj/ControlsViewController.xib",
|
|
68
|
-
"app/en.lproj/ImagesViewController.xib",
|
|
69
|
-
"app/en.lproj/Localizable.strings",
|
|
70
|
-
"app/en.lproj/MainWindow.xib",
|
|
71
|
-
"app/en.lproj/PickerViewController.xib",
|
|
72
|
-
"app/en.lproj/SearchBarController.xib",
|
|
73
|
-
"app/en.lproj/SegmentViewController.xib",
|
|
74
|
-
"app/en.lproj/TextFieldController.xib",
|
|
75
|
-
"app/en.lproj/TextViewController.xib",
|
|
76
|
-
"app/en.lproj/ToolbarViewController.xib",
|
|
77
|
-
"app/en.lproj/TransitionViewController.xib",
|
|
78
|
-
"app/en.lproj/WebViewController.xib",
|
|
79
|
-
"app/images/12-6AM.png",
|
|
80
|
-
"app/images/12-6PM.png",
|
|
81
|
-
"app/images/6-12AM.png",
|
|
82
|
-
"app/images/6-12PM.png",
|
|
83
|
-
"app/images/Default.png",
|
|
84
|
-
"app/images/Icon.png",
|
|
85
|
-
"app/images/UIButton_custom.png",
|
|
86
|
-
"app/images/blueButton.png",
|
|
87
|
-
"app/images/orangeslide.png",
|
|
88
|
-
"app/images/scene1.jpg",
|
|
89
|
-
"app/images/scene2.jpg",
|
|
90
|
-
"app/images/scene3.jpg",
|
|
91
|
-
"app/images/scene4.jpg",
|
|
92
|
-
"app/images/scene5.jpg",
|
|
93
|
-
"app/images/segment_check.png",
|
|
94
|
-
"app/images/segment_search.png",
|
|
95
|
-
"app/images/segment_tools.png",
|
|
96
|
-
"app/images/slider_ball.png",
|
|
97
|
-
"app/images/whiteButton.png",
|
|
98
|
-
"app/images/yellowslide.png",
|
|
99
|
-
"app/main.m",
|
|
30
|
+
"app/LICENSE",
|
|
31
|
+
"app/Readme.markdown",
|
|
32
|
+
"app/Shared/AppDelegate_Shared.h",
|
|
33
|
+
"app/Shared/AppDelegate_Shared.m",
|
|
34
|
+
"app/Shared/Icon.png",
|
|
35
|
+
"app/Shared/ModalViewController.h",
|
|
36
|
+
"app/Shared/ModalViewController.m",
|
|
37
|
+
"app/Shared/TestViewController_Shared.h",
|
|
38
|
+
"app/Shared/TestViewController_Shared.m",
|
|
39
|
+
"app/Shared/Universal-Info.plist",
|
|
40
|
+
"app/Shared/Universal_Prefix.pch",
|
|
41
|
+
"app/Shared/main.m",
|
|
42
|
+
"app/Universal.xcodeproj/project.pbxproj",
|
|
43
|
+
"app/iPad/AppDelegate_Pad.h",
|
|
44
|
+
"app/iPad/AppDelegate_Pad.m",
|
|
45
|
+
"app/iPad/Default-Landscape.png",
|
|
46
|
+
"app/iPad/Default-Portrait.png",
|
|
47
|
+
"app/iPad/MainWindow_Pad.xib",
|
|
48
|
+
"app/iPad/TestViewController_Pad.h",
|
|
49
|
+
"app/iPad/TestViewController_Pad.m",
|
|
50
|
+
"app/iPhone/AppDelegate_Phone.h",
|
|
51
|
+
"app/iPhone/AppDelegate_Phone.m",
|
|
52
|
+
"app/iPhone/Default.png",
|
|
53
|
+
"app/iPhone/MainWindow_Phone.xib",
|
|
54
|
+
"app/iPhone/TestViewController_Phone.h",
|
|
55
|
+
"app/iPhone/TestViewController_Phone.m",
|
|
56
|
+
"bin/.gitignore",
|
|
57
|
+
"bin/icuke",
|
|
58
|
+
"bin/icuke-module",
|
|
59
|
+
"ext/.gitignore",
|
|
60
|
+
"ext/Rakefile",
|
|
61
|
+
"ext/WaxSim/Simulator.h",
|
|
62
|
+
"ext/WaxSim/Simulator.m",
|
|
63
|
+
"ext/WaxSim/WaxSim.m",
|
|
64
|
+
"ext/WaxSim/WaxSim.xcodeproj/project.pbxproj",
|
|
65
|
+
"ext/WaxSim/WaxSim_Prefix.pch",
|
|
66
|
+
"ext/WaxSim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h",
|
|
100
67
|
"ext/iCuke/.gitignore",
|
|
101
|
-
"ext/iCuke/DefaultsResponse.h",
|
|
102
|
-
"ext/iCuke/DefaultsResponse.m",
|
|
103
|
-
"ext/iCuke/EventResponse.h",
|
|
104
|
-
"ext/iCuke/EventResponse.m",
|
|
105
68
|
"ext/iCuke/Rakefile",
|
|
106
|
-
"ext/iCuke/
|
|
107
|
-
"ext/iCuke/
|
|
108
|
-
"ext/iCuke/RecorderResponse.h",
|
|
109
|
-
"ext/iCuke/RecorderResponse.m",
|
|
110
|
-
"ext/iCuke/SynthesizeSingleton.h",
|
|
111
|
-
"ext/iCuke/ViewResponse.h",
|
|
112
|
-
"ext/iCuke/ViewResponse.m",
|
|
113
|
-
"ext/iCuke/Viewer.h",
|
|
114
|
-
"ext/iCuke/Viewer.m",
|
|
115
|
-
"ext/iCuke/iCukeHTTPResponseHandler.h",
|
|
116
|
-
"ext/iCuke/iCukeHTTPResponseHandler.m",
|
|
117
|
-
"ext/iCuke/iCukeHTTPServer.h",
|
|
118
|
-
"ext/iCuke/iCukeHTTPServer.m",
|
|
119
|
-
"ext/iCuke/iCukeServer.h",
|
|
120
|
-
"ext/iCuke/iCukeServer.m",
|
|
121
|
-
"ext/iCuke/json/JSON.h",
|
|
122
|
-
"ext/iCuke/json/NSObject+SBJSON.h",
|
|
123
|
-
"ext/iCuke/json/NSObject+SBJSON.m",
|
|
124
|
-
"ext/iCuke/json/NSString+SBJSON.h",
|
|
125
|
-
"ext/iCuke/json/NSString+SBJSON.m",
|
|
126
|
-
"ext/iCuke/json/SBJSON.h",
|
|
127
|
-
"ext/iCuke/json/SBJSON.m",
|
|
128
|
-
"ext/iCuke/json/SBJsonBase.h",
|
|
129
|
-
"ext/iCuke/json/SBJsonBase.m",
|
|
130
|
-
"ext/iCuke/json/SBJsonParser.h",
|
|
131
|
-
"ext/iCuke/json/SBJsonParser.m",
|
|
132
|
-
"ext/iCuke/json/SBJsonWriter.h",
|
|
133
|
-
"ext/iCuke/json/SBJsonWriter.m",
|
|
69
|
+
"ext/iCuke/libicuke-sdk3.1.dylib",
|
|
70
|
+
"ext/iCuke/libicuke-sdk4.0.dylib",
|
|
134
71
|
"ext/iCuke/libicuke.dylib",
|
|
72
|
+
"ext/iCuke/sdk3.1/DefaultsResponse.h",
|
|
73
|
+
"ext/iCuke/sdk3.1/DefaultsResponse.m",
|
|
74
|
+
"ext/iCuke/sdk3.1/EventResponse.h",
|
|
75
|
+
"ext/iCuke/sdk3.1/EventResponse.m",
|
|
76
|
+
"ext/iCuke/sdk3.1/ModuleResponse.h",
|
|
77
|
+
"ext/iCuke/sdk3.1/ModuleResponse.m",
|
|
78
|
+
"ext/iCuke/sdk3.1/Rakefile",
|
|
79
|
+
"ext/iCuke/sdk3.1/Recorder.h",
|
|
80
|
+
"ext/iCuke/sdk3.1/Recorder.m",
|
|
81
|
+
"ext/iCuke/sdk3.1/RecorderResponse.h",
|
|
82
|
+
"ext/iCuke/sdk3.1/RecorderResponse.m",
|
|
83
|
+
"ext/iCuke/sdk3.1/SynthesizeSingleton.h",
|
|
84
|
+
"ext/iCuke/sdk3.1/ViewResponse.h",
|
|
85
|
+
"ext/iCuke/sdk3.1/ViewResponse.m",
|
|
86
|
+
"ext/iCuke/sdk3.1/Viewer.h",
|
|
87
|
+
"ext/iCuke/sdk3.1/Viewer.m",
|
|
88
|
+
"ext/iCuke/sdk3.1/iCukeHTTPResponseHandler.h",
|
|
89
|
+
"ext/iCuke/sdk3.1/iCukeHTTPResponseHandler.m",
|
|
90
|
+
"ext/iCuke/sdk3.1/iCukeHTTPServer.h",
|
|
91
|
+
"ext/iCuke/sdk3.1/iCukeHTTPServer.m",
|
|
92
|
+
"ext/iCuke/sdk3.1/iCukeServer.h",
|
|
93
|
+
"ext/iCuke/sdk3.1/iCukeServer.m",
|
|
94
|
+
"ext/iCuke/sdk3.1/json/JSON.h",
|
|
95
|
+
"ext/iCuke/sdk3.1/json/NSObject+SBJSON.h",
|
|
96
|
+
"ext/iCuke/sdk3.1/json/NSObject+SBJSON.m",
|
|
97
|
+
"ext/iCuke/sdk3.1/json/NSString+SBJSON.h",
|
|
98
|
+
"ext/iCuke/sdk3.1/json/NSString+SBJSON.m",
|
|
99
|
+
"ext/iCuke/sdk3.1/json/SBJSON.h",
|
|
100
|
+
"ext/iCuke/sdk3.1/json/SBJSON.m",
|
|
101
|
+
"ext/iCuke/sdk3.1/json/SBJsonBase.h",
|
|
102
|
+
"ext/iCuke/sdk3.1/json/SBJsonBase.m",
|
|
103
|
+
"ext/iCuke/sdk3.1/json/SBJsonParser.h",
|
|
104
|
+
"ext/iCuke/sdk3.1/json/SBJsonParser.m",
|
|
105
|
+
"ext/iCuke/sdk3.1/json/SBJsonWriter.h",
|
|
106
|
+
"ext/iCuke/sdk3.1/json/SBJsonWriter.m",
|
|
107
|
+
"ext/iCuke/sdk4.0/DefaultsResponse.h",
|
|
108
|
+
"ext/iCuke/sdk4.0/DefaultsResponse.m",
|
|
109
|
+
"ext/iCuke/sdk4.0/EventResponse.h",
|
|
110
|
+
"ext/iCuke/sdk4.0/EventResponse.m",
|
|
111
|
+
"ext/iCuke/sdk4.0/ModuleResponse.h",
|
|
112
|
+
"ext/iCuke/sdk4.0/ModuleResponse.m",
|
|
113
|
+
"ext/iCuke/sdk4.0/Rakefile",
|
|
114
|
+
"ext/iCuke/sdk4.0/Recorder.h",
|
|
115
|
+
"ext/iCuke/sdk4.0/Recorder.m",
|
|
116
|
+
"ext/iCuke/sdk4.0/RecorderResponse.h",
|
|
117
|
+
"ext/iCuke/sdk4.0/RecorderResponse.m",
|
|
118
|
+
"ext/iCuke/sdk4.0/SynthesizeSingleton.h",
|
|
119
|
+
"ext/iCuke/sdk4.0/ViewResponse.h",
|
|
120
|
+
"ext/iCuke/sdk4.0/ViewResponse.m",
|
|
121
|
+
"ext/iCuke/sdk4.0/Viewer.h",
|
|
122
|
+
"ext/iCuke/sdk4.0/Viewer.m",
|
|
123
|
+
"ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.h",
|
|
124
|
+
"ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.m",
|
|
125
|
+
"ext/iCuke/sdk4.0/iCukeHTTPServer.h",
|
|
126
|
+
"ext/iCuke/sdk4.0/iCukeHTTPServer.m",
|
|
127
|
+
"ext/iCuke/sdk4.0/iCukeServer.h",
|
|
128
|
+
"ext/iCuke/sdk4.0/iCukeServer.m",
|
|
129
|
+
"ext/iCuke/sdk4.0/json/JSON.h",
|
|
130
|
+
"ext/iCuke/sdk4.0/json/NSObject+SBJSON.h",
|
|
131
|
+
"ext/iCuke/sdk4.0/json/NSObject+SBJSON.m",
|
|
132
|
+
"ext/iCuke/sdk4.0/json/NSString+SBJSON.h",
|
|
133
|
+
"ext/iCuke/sdk4.0/json/NSString+SBJSON.m",
|
|
134
|
+
"ext/iCuke/sdk4.0/json/SBJSON.h",
|
|
135
|
+
"ext/iCuke/sdk4.0/json/SBJSON.m",
|
|
136
|
+
"ext/iCuke/sdk4.0/json/SBJsonBase.h",
|
|
137
|
+
"ext/iCuke/sdk4.0/json/SBJsonBase.m",
|
|
138
|
+
"ext/iCuke/sdk4.0/json/SBJsonParser.h",
|
|
139
|
+
"ext/iCuke/sdk4.0/json/SBJsonParser.m",
|
|
140
|
+
"ext/iCuke/sdk4.0/json/SBJsonWriter.h",
|
|
141
|
+
"ext/iCuke/sdk4.0/json/SBJsonWriter.m",
|
|
142
|
+
"features/iphone.feature",
|
|
135
143
|
"features/support/env.rb",
|
|
136
|
-
"features/uicatalog.feature",
|
|
137
144
|
"iCuke.gemspec",
|
|
138
145
|
"lib/icuke.rb",
|
|
139
|
-
"lib/icuke/com.apple.Accessibility.plist",
|
|
140
146
|
"lib/icuke/core_ext.rb",
|
|
141
147
|
"lib/icuke/cucumber.rb",
|
|
142
|
-
"lib/icuke/
|
|
148
|
+
"lib/icuke/screen.rb",
|
|
149
|
+
"lib/icuke/sdk.rb",
|
|
143
150
|
"lib/icuke/simulate.rb",
|
|
144
151
|
"lib/icuke/simulator.rb",
|
|
145
|
-
"lib/icuke/
|
|
152
|
+
"lib/icuke/waxsim.rb"
|
|
146
153
|
]
|
|
147
154
|
s.homepage = %q{http://github.com/unboxed/iCuke}
|
|
148
155
|
s.rdoc_options = ["--charset=UTF-8"]
|
|
@@ -156,18 +163,15 @@ Gem::Specification.new do |s|
|
|
|
156
163
|
|
|
157
164
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
|
158
165
|
s.add_runtime_dependency(%q<cucumber>, [">= 0"])
|
|
159
|
-
s.add_runtime_dependency(%q<rb-appscript>, [">= 0"])
|
|
160
166
|
s.add_runtime_dependency(%q<httparty>, [">= 0"])
|
|
161
167
|
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
|
162
168
|
else
|
|
163
169
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
|
164
|
-
s.add_dependency(%q<rb-appscript>, [">= 0"])
|
|
165
170
|
s.add_dependency(%q<httparty>, [">= 0"])
|
|
166
171
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
|
167
172
|
end
|
|
168
173
|
else
|
|
169
174
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
|
170
|
-
s.add_dependency(%q<rb-appscript>, [">= 0"])
|
|
171
175
|
s.add_dependency(%q<httparty>, [">= 0"])
|
|
172
176
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
|
173
177
|
end
|