私は Ryan Bates の RailsCasts を何年も前から見ており、サイトの有料部分の顧客でもあります。過去に Cucumber のエピソードを見て BDD を学びました。
TestUnit、RSpec、Capybara、MiniTest について学びました。私は何が何であるかについて混乱し始めています。
この4つのアイテムの違いは何ですか?Cucumber がプレーン テキスト機能を実行することは明らかであり、それは統合テストと見なすことができると思います。
しかし、最近のバージョンの Cucumber には MiniTest が必要であることがわかりましたか? Cucumber は、テスト フレームワークの上にある単なる DSL ですか?
RSpecには、アサーションを行うための独自の構文糖衣、「記述」ブロックがあることも知っています。また、MiniTest もこの構文をサポートしているようです。
生成されたWebページのコンテンツを見るためにCapybaraが使われていることは知っていると思います。
これが私の質問です:
新しい Rails 3.2 アプリケーションを作成する場合、これらのテスト プログラムのどの組み合わせを使用すればよいですか? さらに役立つのは、これらの宝石とそれに関連するプロセスが、該当する場合にどのように相互に補完するかを説明するリストです。
Cucumber is a DSL for driving BDD
Cucumber is for integration tests and is based on creating user stories that are customer-readable
It implements its tests behind the scenes via MiniTest
MiniTest is a new testing framework that comes with Ruby 1.9 and is very fast.
MiniTest is also used for unit testing, such as testing controllers and models
It does not yet have as many features as RSpec
Cucumber also uses Capybara to access DOM elements from a javascript-enabled browser simulator such as Selenium
When you test in Rails, you have the ability to do the following kinds of tests: controllers, views, models, and integration (MVC together)
Some people just do integration and model testing, because they feel that integration testing handles enough of the controller and view testing itself, and anything too complex can simply be moved up to the model
私のためにこれらのアイデアを解決するためにあなたが提供できるあらゆる助けに感謝します.