私は数年前からRyan BatesのRailsCastを見てきました。私はサイトの有料部分の顧客でもあります。私は過去にキュウリのエピソードを見てBDDを学んだ。Rails 3のテストフレームワークの混乱
今、私はTestUnit、RSpec、Capybara、およびMiniTestについて学びました。私は何が何であるのか混乱し始めている。
これらの4つの項目の違いは何ですか?私は明らかにCucumberがプレーンテキスト機能を実行することを知っており、これは統合テストと見なすことができると思います。
しかし、最近のキュウリの最新バージョンではMiniTestが必要ですか?キュウリは単にテストフレームワークの上に座っているDSLですか?
RSpecには、アサーションを行うための独自の構文的砂糖「記述」ブロックがあります。 MiniTestもこの構文をサポートしているようです。
私はCapybaraが生成されたWebページのコンテンツを見るために使用されていることを知っています。ここで
は私の質問です:
私は新しいの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
あなたは私のためにこれらのアイデアをクリアするために提供することができます任意の助けのためにどうもありがとうございます:どのような追加の参考になることは該当する場合、これらの宝石とそれに関連するプロセスは以下のように、お互いを補完する方法を説明したリストです。
非常に役に立ちます。 DVGありがとうございました。 – Saim