File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 5
5
6
6
@interface DPLRouteMatcher ()
7
7
8
- @property (nonatomic , copy ) NSString *route;
9
8
@property (nonatomic , strong ) DPLRegularExpression *regexMatcher;
10
- @property (nonatomic , strong ) NSMutableArray *routeParamaterNames;
11
9
12
10
@end
13
11
@@ -25,22 +23,13 @@ - (instancetype)initWithRoute:(NSString *)route {
25
23
26
24
self = [super init ];
27
25
if (self) {
28
- _route = route;
29
26
_regexMatcher = [DPLRegularExpression regularExpressionWithPattern: route];
30
27
}
31
28
32
29
return self;
33
30
}
34
31
35
32
36
- - (NSMutableArray *)routeParamaterNames {
37
- if (!_routeParamaterNames) {
38
- _routeParamaterNames = [NSMutableArray array ];
39
- }
40
- return _routeParamaterNames;
41
- }
42
-
43
-
44
33
- (DPLDeepLink *)deepLinkWithURL : (NSURL *)url {
45
34
46
35
DPLDeepLink *deepLink = [[DPLDeepLink alloc ] initWithURL: url];
Original file line number Diff line number Diff line change 9
9
SpecBegin (DPLRouteMatcher)
10
10
11
11
12
+ describe(@" Initialization" , ^{
13
+ it (@" creates an instance with a route" , ^{
14
+ DPLRouteMatcher *routeMatcher = [DPLRouteMatcher matcherWithRoute: @" /thing/:another" ];
15
+ expect (routeMatcher).notTo .beNil ();
16
+ });
17
+
18
+ it (@" does not create an instance with no route" , ^{
19
+ DPLRouteMatcher *routeMatcher = [DPLRouteMatcher matcherWithRoute: @" " ];
20
+ expect (routeMatcher).to .beNil ();
21
+ });
22
+ });
23
+
12
24
describe (@" Matching Routes" , ^{
13
25
14
26
it (@" returns a deep link when a URL matches a route" , ^{
You can’t perform that action at this time.
0 commit comments