What does Steak add beyond just using Capybara and RSpec in Rails testing?

后端 未结 2 2138
面向向阳花
面向向阳花 2021-01-04 23:15

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

2条回答
  •  既然无缘
    2021-01-05 00:04

    Technically speaking Steak just adds three things:

    • 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.

    • A couple of convenient generators for Rails that help developers to quickly set up a new project or a new spec

    • Rake support to run your acceptance specs in isolation, among other things.

    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:

    • 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.

    • It provides a community (mailing list, wiki, twitter account…) of developers doing this particular form of testing, sharing experiences, problems and best practices.

    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.

提交回复
热议问题