A lightweight mocking framework for Objective-C that supports class mocks and partial mocks, integrating seamlessly with Xcode for unit testing.
- v3.9.4
- Published at
- May 26, 2024
- 2,167
- Stars
- 105,308
- Download
- Synced at
- Oct 4, 2026
Latest release
v3.9.4May 26, 2024, 06:38 PMDownloads slow? Switch the source anytime above
README
Project Overview
OCMock is a lightweight mocking framework for Objective-C that allows you to create mock objects for unit testing.
Key Features
- Create mock objects and partial mocks
- Stub and verify behavior
- Integration with Xcode
- Support for class method and instance method mocking
Target Audience
- iOS and macOS developers
- Engineers doing unit testing
- Teams using Objective-C
Quick Start
- Integrate OCMock into your project via CocoaPods or manually
- Import OCMock headers in your test files
- Create a mock:
id mock = OCMClassMock([SomeClass class]) - Stub and verify behavior
Core Advantages
- Lightweight and easy to integrate
- Class and partial mock support
- Active community and documentation
Release history
Sort