unit test in Objective C
是否有任何方法可以在目标C中应用脚本或测试用例,以便它能够更详细地了解应用程序行为并自动创建一些日志?
看看Kiwi,它伟大的BDD单元测试。
https://github.com/allending/kiwi
取自Github页面Kiwi背后的想法是拥有比捆绑测试框架更具可读性的测试。
测试(或者更确切地说是规范)是用Objective-C编写的,并在Xcode的舒适环境中运行,以提供一个在运行测试和错误报告方面尽可能不引人注目和无缝的测试环境。
规格如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 | describe(@"Team", ^{ context(@"when newly created", ^{ it(@"should have a name", ^{ id team = [Team team]; [[team.name should] equal:@"Black Hawks"]; }); it(@"should have 11 players", ^{ id team = [Team team]; [[[team should] have:11] players]; }); }); }); |