Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 25 lines (19 sloc) 0.783 kb
ad2c51d Tom Ward Initial commit of code extracted from my super-secret iPhone project
authored
1 //
2 // InflectorTest.m
c49db0e Sam Soffes Cleaned up a bit and added category
soffes authored
3 // ActiveSupportInflector
ad2c51d Tom Ward Initial commit of code extracted from my super-secret iPhone project
authored
4 //
5
c49db0e Sam Soffes Cleaned up a bit and added category
soffes authored
6 #import "NSString+ActiveSupportInflector.h"
ad2c51d Tom Ward Initial commit of code extracted from my super-secret iPhone project
authored
7
c49db0e Sam Soffes Cleaned up a bit and added category
soffes authored
8 @interface ActiveSupportInflectorTest : SenTestCase
ad2c51d Tom Ward Initial commit of code extracted from my super-secret iPhone project
authored
9 @end
10
11 @implementation ActiveSupportInflectorTest
12
c49db0e Sam Soffes Cleaned up a bit and added category
soffes authored
13 - (void)testPluralizationAndSingularization {
ad2c51d Tom Ward Initial commit of code extracted from my super-secret iPhone project
authored
14 NSDictionary* dictionary = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:@"ActiveSupportInflectorTest" ofType:@"plist"]];
15 NSArray* singularAndPlural = [dictionary objectForKey:@"singularAndPlural"];
16 for (NSArray* sAndP in singularAndPlural) {
17 NSString* singular = [sAndP objectAtIndex:0];
18 NSString* plural = [sAndP objectAtIndex:1];
c49db0e Sam Soffes Cleaned up a bit and added category
soffes authored
19
20 assertThat(plural, equalTo([singular pluralizeString]));
21 assertThat(singular, equalTo([plural singularizeString]));
ad2c51d Tom Ward Initial commit of code extracted from my super-secret iPhone project
authored
22 }
c49db0e Sam Soffes Cleaned up a bit and added category
soffes authored
23 }
24
ad2c51d Tom Ward Initial commit of code extracted from my super-secret iPhone project
authored
25 @end
Something went wrong with that request. Please try again.