Rails 使用哪些测试框架? [英] What testing frameworks are used for Rails?

查看:42
本文介绍了Rails 使用哪些测试框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Rails 使用哪些单元测试框架?

What unit testing frameworks are used for Rails?

我正在阅读一本书(Pragmatic Programmers Agile Dev. with Rails),其中展示了如何在 Rails 中进行单元测试.

I am reading the book (Pragmatic Programmers Agile Dev. with Rails) which shows how to do unit tests in Rails.

这本书向我展示了默认的 Rails 测试套件(Test::Unit 的子类).这是 Rails 社区中使用的主要测试框架吗?我在做常规 ruby​​ 时使用 RSpec,我也希望能够在 Rails 中使用它(如果不是太麻烦的话)?

The book showed me the default rails testing suite (a subclass of Test::Unit). Is this the main testing framework that is used in the Rails community? I use RSpec when doing regular ruby, and I would like to be able to use it in Rails too (if it's not too much of a hassle)?

推荐答案

Rspec 广泛用于 rails,并与 Cucumber 结合使用a>,是当今使用最广泛的解决方案之一.请注意,rails 3 使用的是 rspec 2,因此请查找 rspec/rails.查看 pragprog.com 的 rspec 和黄瓜一书,这是核心团队编写的重要资源.http://pragprog.com/titles/achbd/the-rspec-book

Rspec is widely used in rails, and in conjunction with Cucumber, is one of the most widely used solutions today. note that rails 3 is using rspec 2, so look for rspec/rails. check out the pragprog.com book rspec and cucumber, a great resource written by the core teams. http://pragprog.com/titles/achbd/the-rspec-book

这篇关于Rails 使用哪些测试框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆