News

OCMock 3.4 released

This release brings the ability to mock managed objects. It also includes a number of smaller improvements and bugfixes. Details can be found in the change log

Note: This release requires iOS 8 as a deployment target because Xcode 8 does not seem to want to build binaries with an older deployment target.

OCMock 3.3 released

This release brings some thread-safety to OCMock. Up until now OCMock was not thread-aware at all. Any combination of operations on a mock object from multiple threads was likely to cause issues and make the test fail. As of OCMock 3.3 it is still necessary to invoke all setup and verification operations from a single thread, preferrably the main thread of the test runner. It is possible, though, to use the mock object from multiple threads. The mock object can even be used from a different thread while its setup continues in the main thread.

Also included is a modern syntax for rejecting methods. See section 9.1 in the documentation for details.

OCMock 3.2 released

This release brings a couple of new features and bugfixes for C++ users. Details can be found in the change log. Even though it is built with iOS 9, this release does not yet address the known performance issue with iOS 9 (see #253).

Performance issue with iOS 9

We are aware of a perfomance degradation caused by the iOS 9 runtime (see #253). Moving to an older version of OCMock does not help. Building with iOS 8.x does.

OCMock supports Carthage

With the release of OCMock 3.1.3 the Carthage dependency manager is supported. Compatible binary releases are published on Github.

10 Years of OCMock

Today is the 10th anniversary of OCMock’s first release. The original code for that release is preserved in the Git repo. Looking back I find it surprising with how little code it all began.

OCMock 3.1 released

This release focuses on performance and stability following the major changes implemented in OCMock 3. It also adds a couple of convenience features. Details can be found in the change log.

OCMock 3.0 released

Released about a month before the project’s 10th anniversary, OCMock 3.0 brings a new modern syntax and support for a verify-after-running testing style. Backwards compatibility with previous versions of OCMock should be very high but there have been some changes in the implementation that may result in subtle issues. For a description of the changes please see What’s new in OCMock 3.

OCMock and Swift

Obviously just before the release of OCMock 3, quite surprisingly to almost everyone, Apple announced a new programming language for iOS and OS X development. Early experiments show that OCMock can be used with Swift, with some limitations. I’ve begun to describe this on the OCMock and Swift page.

OCMock 3.0 Milestone 3 released

The third and final milestone has been reached. OCMock 3 is now feature complete. Backwards compatibility should be very high but there have been some changes in the implementation that may result in subtle issues. If you have an existing project that uses OCMock 2, please try this release and report any issues you encounter. You can leave feedback one the OCMock 3 roadmap page or report them via Github.

OCMock 3.0 Milestone 2 released

OCMock 3 milestone 2 has been reached. This brings support for verify-after-run for regular mocks and for methods called on partial mocks. More details on the OCMock 3 roadmap page. You are invited to leave feedback directly on that page.

OCMock 3.0 Milestone 1 released

Work on OCMock 3 is progressing nicely and milestone 1 has been reached. A description of the changes as well as downloads can be found on the OCMock 3 roadmap page. You are invited to leave feedback directly on that page.

Roadmap for OCMock 3 published

Work on OCMock 3 has begun. The first commits are in the repository and we have published a roadmap. You can leave feedback directly on the roadmap page.

OCMock 2.2.4 released

New minor release (2.2.4) introducing a verifyWithDelay: method, andForwardToRealObject for class methods, and a few bug fixes.

Notice of planned license change

For OCMock 3, due in Spring, I’m planning to switch the license to an Apache 2 license. Should you have any concerns please get in touch in the next few weeks. If you have committed code to OCMock, a quick note by email stating that you are okay with the change would be appreciated.

OCMock 2.2.3 released

New minor release (2.2.3) that actually includes ARM 64-bit build. No functional changes compared to previous version.

OCMock 2.2.2 released

New minor release (2.2.2) that brings full support for ARM 64-bit builds on iOS. Also included are several bug fixes. For details see the change log.

OCMock 2.2.1 released

New minor release (2.2.1) that fixes some bugs related to mocking class methods.

OCMock 2.2 released

New release (2.2) that improves weak matching for non-object arguments. A mock can now be told to ignore non-object arguments when matching invocations. More on the features page.

OCMock 2.1.2 released

New minor release (2.1.2) that includes fixes for compatibility with Xcode 5 Preview.

OCMock 2.1 released

New release (2.1) which adds support for stubbing class methods and includes many contributed bug fixes. This release is compatible with Xcode 4.5/4.6.

New Website

We have an updated website. Granted, the content hasn’t changed too much but the site should be easier to navigate and bookmark. In case you care, it’s generated with Jekyll and the source code for the site itself is here.

Forums Are Back

The forums are working properly again. Apologies for the issues. The underlying problem was an incompatibility between our forum software and a new version of PHP. If you still encounter any errors please contact me by email.

AppCode license

The nice folks at Jetbrains have made an open source license of their AppCode IDE available for use by the OCMock developers. Thanks!

OCMock 2.0 released

New binary release (2.0) bringing compatibility with iOS 5 and Xcode 4.2/4.3. The version is 2.0 not because of a major change in OCMock itself but because the 1.x numbering scheme depended on Subversion, and the code is now on Github.

Some Infrastructure Changes

Following public demand the source code for OCMock is now on GitHub (erikdoe/ocmock). Going forward this will be the master repository for the source code. Because the current version numbers are based on the Subversion revisions we will introduce a new numbering scheme with the next release.

OCMock 1.77 released

New release bringing Xcode 4 compatibility, an explicit check to see whether the static library has been linked correctly, and a feature to stop a partial mock from intercepting calls to the underlying object.

OCMock 1.70 released

New release which adds the following features: support for blocks, static library for iOS development, forwarding of methods from a partial mock to the real object, and rejecting methods when using nice mocks. All new features are highlighted on the “Features” tab on this page, and the static library is described in detail on the “iPhone/iOS” tab.

OCMock 1.55 released

New release offering several new features, including partial mocks, method swizzling, posting of notifications, and verification of call sequence, as well as a handful of bug fixes. Details in the “Features” tab on this page and in the change notes.

New Support Forum

The mailing list is great for submitting patches and discussing future development of OCMock. To just get a quick answer for a problem using OCMock it might be a bit too involved, which is why we’re going to trial the use of a web-based forum. Have a look at the brand new OCMock Forum.

OCMock 1.42 released

New release which combines several contributions, adding support for mock observers of notifications, setters for pass-by-reference arguments, and several improvements to existing features. The default binary release now uses @rpath, which allows for more flexible deployment, and it supports garbage collection.

OCMock 1.29 released

With this new release OCMock supports hamcrest matchers like this:

[[mock expect] doSomething:startsWith(@"foo")]

OCMock 1.17 released

New release which combines several contributions. Added nice mocks, which ignore unexpected invocations, and exceptions meant to cause the test to fail fast are now rethrown in verify.

OCMock 1.10 released

New release which has support for mocking protocols. Also added XCode 2.1 compliant project files and moved to built-in OCUnit.

Switch to NSProxy

Changed a small but important detail; the MockObject and MockRecorder classes now inherit from NSProxy which carries much less baggage in terms of methods that cannot be mocked because they are defined by the base class.

OCMock released

First public release. I am using the Subversion revision numbers to version the releases, which is why we start with 1.4 and not 1.0 as one could expect.

OCMock announced

While working on a new Objective-C project, a Mac OS X monitor for DamageControl, I decide that I’ve gotten so used to developing test-first and using mock objects that I will bite the bullet and do a simple mock objects implementation in Objective-C. It’ll be basic but since Objective-C is so dynamic I probably only need a fraction of the code needed for the Java and .NET versions.