CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✓ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Jan 2017 |
Maintained by Hai Feng Kao.
Do you want to know if there is a memory leak in your XCTest? This is the tool for you.
Motivated by Leak Canary and HeapInspector.
Add the follow codes to your test case
- (void)setUp
{
[LeakCanary beginSnapShot:@[@"UIView"]];
}
- (void)tearDown
{
NSSet* leakedObjects = [LeakCanary endSnapShot];
XCTAssertTrue(leakedObjects.count == 0, @"should not have leaked UIView and UIViewController objects");
}If you use Kiwi
#import <LeakCanary/LeakCanary.h>
#import <Kiwi/Kiwi.h>
beforeEach(^{
[LeakCanary beginSnapShot:@[@"UIView"]];
});
afterEach(^{
NSSet* leakedObjects = [LeakCanary endSnapShot];
[[@(leakedObjects.count) should] equal:@(0)];
});LeakCanaryiOS is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "LeakCanaryiOS"Hai Feng Kao, [email protected]
LeakCanaryiOS is available under the MIT license. See the LICENSE file for more info.