Does cucumber do away with the need to write unit tests?

前端 未结 7 1155
予麋鹿
予麋鹿 2021-02-12 11:35

I am a little confused by the sheer number of testing frameworks available for Ruby/ROR.

I have recently watched the Cucumber Railscasts and found them very interesting.

相关标签:
7条回答
  • 2021-02-12 12:22

    I have thought/struggled with this question much, and here's where I've arrived.

    Cucumber first and Cucumber last. Cucumber will provide the primary test coverage.

    The core model methods that do the real business work of the application should also be developed/covered with rspec/unit tests.

    Why the unit tests as well?

    1) The unit tests will test run much faster. 2) This core business logic may (will probably) be used in several ways beyond the current views (which Cucumber tests through). These methods ought to be hammered with all types of possible inputs and outputs directly calling the method in the test.

    Why not unit test the rest of the models, and the controllers and views?

    1) Cucumber already has it covered once. 2) I find that the views-controller-some-model-methods all work together to get things done (think everything exercised to log in); so I like to test them together.

    0 讨论(0)
提交回复
热议问题