TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2015 |
Maintained by Unclaimed.
Simple HTTP request mocking/interception for testing module.
Inspired by chrisk's fakeweb.
Required files on to use this library
FakeWeb.h
FakeWeb.m
FakeWebResponder.h
FakeWebResponder.m
FakeWeb+Private.h
If you use HTTP Library "ASIHTTPRequest", add this file.
ASIHTTPRequest+FakeWeb.h
ASIHTTPRequest+FakeWeb.m
If you use HTTP Library "NSURLConnection", add this file.
NSURLConnection+FakeWeb.h
NSURLConnection+FakeWeb.m
※ If you use other HTTP Libaray depends on "NSURLConnection", this is to solve it by using this "NSURLConnection+FakeWeb.h".
simple case:
#import "FakeWeb.h"
NSString *urlString = @"http://google.com";
[FakeWeb registerUri:urlString method:@"GET" body:@"hoge" staus:200];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:urlString]];
[request startSynchronous];
NSLog(@"%@", [request responseString]);
// => hoge
Other uses will see the test case: FakeWebTests/Spec/FakeWebAHIHTTPRequestSpec.m or FakeWebTests/Spec/FakeWebNSURLConnectionSpec.m
Toshihiro Morimoto @dealforest
The details are described in CHANGES.
MIT, the license agreement found in License.txt.