forked from tomafro/ActiveSupportInflector
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathActiveSupportInflectorTest.m
More file actions
28 lines (22 loc) · 875 Bytes
/
ActiveSupportInflectorTest.m
File metadata and controls
28 lines (22 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//
// InflectorTest.m
// ActiveSupportInflector
//
// Created by Tom Ward on 26/05/2009.
// Copyright 2009 Tom Ward. All rights reserved.
//
#import "NSString+ActiveSupportInflector.h"
@interface ActiveSupportInflectorTest : SenTestCase
@end
@implementation ActiveSupportInflectorTest
- (void)testPluralizationAndSingularization {
NSDictionary* dictionary = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"ActiveSupportInflectorTest" ofType:@"plist"]];
NSArray* singularAndPlural = [dictionary objectForKey:@"singularAndPlural"];
for (NSArray* sAndP in singularAndPlural) {
NSString* singular = [sAndP objectAtIndex:0];
NSString* plural = [sAndP objectAtIndex:1];
assertThat(plural, equalTo([singular pluralizeString]));
assertThat(singular, equalTo([plural singularizeString]));
}
}
@end