Swift: Allow creating dynamic mock objects for unit testing

Originator:jan.sabbe
Number:rdar://17489073 Date Originated:2014-06-27
Status:Duplicate Resolved:2014-07-01
Product:Developer Tools Product Version:
Classification:Feature (new) Reproducible:Always
 
In Objective C it is fairly easy to create an object at runtime that implements a certain interface by using things forwardInvocation. This makes creating mock objects in unit tests fairly nice. e.g. [OCMock niceMockForClass:[MyClass class]

It would be nice to have a similar feature-set for Swift that allows creating mock/stub objects. It would also be necessary to have a good reflection api that can understand types.

Comments

Duplicate of 17417424

By jan.sabbe at July 1, 2014, 6:05 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!