牛排宝石解决了什么问题?
我在 Rails 项目的 Capybara+RSpec 中进行了一些集成测试。今天我遇到了 Steak gem,它是 Cucumber 的纯 Ruby 替代品。尽管乍一看我认为它们都没有任何价值。对我来说,Steak 似乎将 describe
重命名为 feature
,将 it
重命名为 scenario
。就我个人而言,我更喜欢描述它,因为我已经习惯了它们,并且我看不出有任何理由使我的验收测试看起来与我的控制器或模型测试不同。
我错过了什么吗?
I have few integration tests in Capybara+RSpec for a Rails project. Today I encountered Steak gem that meant to be pure Ruby alternative to Cucumber. Though at first glance I don't see any value in either of them. For me it looks like Steak renames describe
to feature
and it
to scenario
. Personally i would prefer describe and it because i got used to them and i don't see any reason to make my acceptance tests to look different from my controller or model tests.
Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
牛排是 RSpec+Capybara。 Steak 也是另外三件事:这种 Acceptance BDD 方法的名称(这样人们就知道如何测试,但使用该名称),一种使该方法尽可能方便的宝石(这样您就不必创建每个项目都有相同的目录和帮助程序)以及使用它的开发人员社区(这样,如果您遇到问题,您知道在哪里询问)。
要了解更多理由,您可能需要查看“为什么选择牛排?” 项目自述文件中的部分,或其他StackOverflow awswer。
Steak is RSpec+Capybara. Steak is also these three other things: the name for this Acceptance BDD approach (so that people knows how you test just but using that name), a gem that makes that approach as convenient as possible (so that you don't have to create the same directories and helpers for each project) and a community of developers using it (so that if you have problems, you know where to ask).
For additional rationale, you may want to check out the "Why Steak?" section in the project's README, or this other StackOverflow awswer.