问题描述
我想了解牛排的需要。我得到它像黄瓜,除了你可以使用纯ruby而不是映射你的英语语言规格到ruby像Cucumber,
,但它说,它主要添加一个包装RSpec DSL,并让你使用
I'm trying to understand the need for Steak. I get that its like Cucumber, except that you can use pure ruby instead of mapping your english language specs to ruby like in Cucumber,but it says that it mainly adds a wrapper around the RSpec DSL, and lets you use that
取自:
module Spec::Example::ExampleGroupMethods
alias scenario example
alias background before
end
module Spec::DSL::Main
alias feature describe
end
这是全部吗?我似乎从例子中,你仍然做与水豚和RSpec匹配器重的举起。所以为什么不只是使用水豚与RSpec,而不是添加一个并发症,如牛排在它的顶部?
Is that all? I seems from the examples that you still do the heavy lifting with Capybara and RSpec matchers.. So why not just use Capybara with RSpec instead of adding a complication like Steak on top of it? Are the English language acceptance spec descriptions the only value proposition, or am I missing something else?
感谢
推荐答案
从技术上讲,Steak只是添加了三个东西:
Technically speaking Steak just adds three things:
-
/ strong>以别名(场景,背景,功能)的形式提示他们正在写一个接受规范,而不是一个常规规范。
Some syntactic sugar in the form of aliases (scenario, background, feature) which remind developers that they are writing an acceptance spec, not a regular one.
Rake 可以帮助开发人员快速设置新项目或新规范支持单独运行您的接受规范。
Rake support to run your acceptance specs in isolation, among other things.
您可以将Steak视为RSpec的最小扩展。但是比技术方面更重要的是与牛排相关的非技术性事情:
You can think of Steak as a minimal extension of RSpec. But even more important than the technical things are the non-technical things associated to Steak:
-
用于接受RSPec的BDD。
It provides a name for doing acceptance BDD with RSpec. Saying that you use Steak is shorter than explaining what type of testing you practice.
它提供社群(邮寄清单,维基,twitter帐户...)。
It provides a community (mailing list, wiki, twitter account…) of developers doing this particular form of testing, sharing experiences, problems and best practices.
我不要认为牛排为任何熟悉RSpec的人增加了任何复杂性,但如果你这样认为,并不真正关心所有以前的事情,那么你根本不需要使用RSpec,你可能会更快乐使用Test :: Unit + Capybara。
I don't think Steak adds any complication for anyone familiar with RSpec, but if you think so and you don't really care about all previous things, then you don't need to use RSpec at all, you will probably be happier using just Test::Unit + Capybara.
这篇关于除了在Rails测试中使用Capybara和RSpec外,Steak还增加了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!