rspec 用户故事功能与 Cucumber 的比较
预先说明一下,尽管标题似乎与线程 RSpec vs Cucumber (RSpec Stories ),但是我的问题根本不同。
我了解测试用户故事和单独测试对象行为之间的区别。我的问题是,为什么 Cucumber 通常与 RSpec 结合起来编写用户故事,而 RSpec 自 1.1 以来就具有用户故事功能?是因为 RSpec 的重点仍然是单个对象测试,而 Cucumber 此后大力开发,重点是用户故事吗?
上下文切换是一件痛苦的事情,而我们开发人员需要处理足够多的工具。我更愿意只使用 RSpec,但如果 Cucumber 与 RSpec 有一些重要的区别,请告诉我。
Just to be up front, although the title appears to be similar to the thread RSpec vs Cucumber (RSpec stories), however my question is fundamentally different.
I understand the difference between testing user stories and testing behavior of objects individually. My question is, why is Cucumber usually coupled with RSpec for writing user stories when RSpec has had user story functionality since 1.1? Is it because RSpec's focus remains strong on individual object testing and Cucumber has since been heavily developed with emphasis on user stories?
Context switching is a pain and we developers deal with enough tools. I'd prefer to stick to just RSpec, but if there is some important distinctions that Cucumber has from RSpec, please do let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
区别非常简单:Cucumber 是 RSpec Story Runner。或者更确切地说,Cucumber 是 RSpec Story Runner,做得对。
因此,Cucumber 得到维护,而 RSpec Story Runner 则没有维护。 RSpec Story Runner 已过时且已被弃用,而 Cucumber 则不然。 Cucumber 仍在开发中,而 RSpec Story Runner 则尚未开发。即将发布的 RSpec 不再包含(也不支持)Story Runner。
RBehave(Cucumber 的前身)合并到 RSpec 纯粹是一个历史意外,从一开始就不应该这样做。这就是为什么合并后不久,RSpec Story Runner 的维护者就宣布它死亡并编写了 Cucumber。
The difference is rather simple: Cucumber is the RSpec Story Runner. Or rather, Cucumber is the RSpec Story Runner done right.
So, Cucumber is maintained, the RSpec Story Runner is not. The RSpec Story Runner is obsolete and deprecated, Cucumber isn't. Cucumber is still being developed, the RSpec Story Runner isn't. The impending release of RSpec does no longer contain (nor support) the Story Runner.
The fact that RBehave (Cucumber's pre-cursor) was merged into RSpec was purely a historical accident and should never have been done in the first place. That's why pretty soon after the merge, the maintainer of the RSpec Story Runner declared it dead and wrote Cucumber.