Skip to content

Commit 3f929d8

Browse files
author
wessmith and chrismaddern
committed
Remove unused code. Add init tests for Route matcher
1 parent 7fa5751 commit 3f929d8

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

DeepLinkSDK/RouteMatcher/DPLRouteMatcher.m

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
@interface DPLRouteMatcher ()
77

8-
@property (nonatomic, copy) NSString *route;
98
@property (nonatomic, strong) DPLRegularExpression *regexMatcher;
10-
@property (nonatomic, strong) NSMutableArray *routeParamaterNames;
119

1210
@end
1311

@@ -25,22 +23,13 @@ - (instancetype)initWithRoute:(NSString *)route {
2523

2624
self = [super init];
2725
if (self) {
28-
_route = route;
2926
_regexMatcher = [DPLRegularExpression regularExpressionWithPattern:route];
3027
}
3128

3229
return self;
3330
}
3431

3532

36-
- (NSMutableArray *)routeParamaterNames {
37-
if (!_routeParamaterNames) {
38-
_routeParamaterNames = [NSMutableArray array];
39-
}
40-
return _routeParamaterNames;
41-
}
42-
43-
4433
- (DPLDeepLink *)deepLinkWithURL:(NSURL *)url {
4534

4635
DPLDeepLink *deepLink = [[DPLDeepLink alloc] initWithURL:url];

Tests/RouteMatcher/DPLRouteMatcherSpec.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@
99
SpecBegin(DPLRouteMatcher)
1010

1111

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+
1224
describe(@"Matching Routes", ^{
1325

1426
it(@"returns a deep link when a URL matches a route", ^{

0 commit comments

Comments
 (0)