Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:yfactorial/objectiveresource
Browse files Browse the repository at this point in the history
  • Loading branch information
vickeryj committed Dec 31, 2008
2 parents 106738d + 1b842a7 commit ef69ce1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Classes/DogErrorTest.h
Expand Up @@ -22,3 +22,8 @@
}

@end

@interface DogDoesNotExist : ActiveResource

@end

20 changes: 18 additions & 2 deletions Classes/DogErrorTest.m
Expand Up @@ -10,14 +10,19 @@

@implementation DogError

static NSString *site = @"http://localhost:3000/";
+ (NSString *)getSite {
return site;
return @"http://localhost:3000/";
}

@end

@implementation DogDoesNotExist

+ (NSString *)getSite {
return @"http://localhost:9999/";
}

@end

@implementation DogErrorTest

Expand All @@ -30,4 +35,15 @@ - (void) test404Error {
[aError code]);
}

- (void) testCantFindServer {
NSError *aError;
NSArray * dogs = [DogDoesNotExist findAllWithResponse:&aError];

STAssertTrue([[aError domain] isEqualToString:NSURLErrorDomain],
@"Should have returned NSURLErrorDomain error instead got %@ " , [aError domain]);
STAssertEquals([aError code], NSURLErrorCannotFindHost, @"Should have returned NSURLErrorCannotFindHost(-1003) error instead got %d " ,
[aError code]);

}

@end

0 comments on commit ef69ce1

Please sign in to comment.