是否存在目前适用于iOS4和Xcode4的BDD解决方案? [英] Is there a BDD solution that presently works well with iOS4 and Xcode4?

查看:113
本文介绍了是否存在目前适用于iOS4和Xcode4的BDD解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我一直在努力寻找适用于iOS4和Xcode4的可靠BDD替代品,但是很久以前似乎已经放弃了所有东西,或者 sortof 正在工作但是很混乱。我发现的最佳解决方案叫做Cedar(主要文章,其中包含指向最近更新的项目跟踪器的链接),尽管它存在一些涉及凌乱的解决方法的Xcode4问题,如上所述这里。有谁知道更好的解决方案?谢谢!

So I've been searching pretty hard for a solid BDD alternative for iOS4 and Xcode4, but everything seems to have either been abandoned a long time ago or sortof working but rather messily. The best solution I've found is called Cedar (main article with a link to a recently updated project tracker), though it has some issues with Xcode4 involving a messy workaround, as noted here. Does anyone know of a better solution? Thanks!

编辑:我决定使用OCUnit并将BDD语法转换为测试名称。这不是我理想的解决方案,特别是因为所有测试名称都必须以test(ERRGGHH !!!)为前缀,但我根本无法让Cedar为我的生活工作。 OCHamcrest(一个流行的匹配库)使得这个MUCH更容易忍受,但允许UI测试的东西,不能直接编译到你的代码中,是在Objective-C中,并且可以在Xcode中使用仍然绝对是美味的。

I decided on using OCUnit and mushing the BDD syntax into the test names. This is not my ideal solution, especially since all test names must be prefixed with the word "test" (ERRGGHH!!!), but I simply could not get Cedar working for the life of me. OCHamcrest (a popular matching library) makes this MUCH more tolerable, but something that allows for UI testing, that doesn't compile anything directly into your code, is in Objective-C, and can be used in Xcode would still be absolutely scrumptious.

推荐答案

我尝试过Cedar。我更喜欢 Kiwi 。这很棒!它适用于iOS4和Xcode4,它易于设置,文档很好,并且它有自己的方法用于匹配器,期望,模拟,存根等,如RSpec。所以,这就是你所需要的。您不需要 OCHamcrest OCMock

I've tried Cedar. I prefer Kiwi. It's Awesome! It works well with iOS4 and Xcode4, it's easy to set up, the documentation is good, and it has its own methods for matchers, expectations, mocks, stubs, etc. like RSpec. So, it's all you need. You don't need OCHamcrest or OCMock.

这是我放在一起的一个疯狂的例子: https://gist.github.com/997581

Here's a crazy example I put together: https://gist.github.com/997581

此外,请参阅
iOS测试/规格TDD / BDD和集成&验收测试

这篇关于是否存在目前适用于iOS4和Xcode4的BDD解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆