对于不同类型的 Ruby 应用程序来说,最常用的单元测试框架是什么?
不同的 Web 框架(Rails、Merb、Sinatra、Ramaze 和桌面框架 - Shoes)是否使用相同的单元测试框架?
可以与所有各种 Web 和桌面框架配合使用的最广泛使用的单元测试框架是什么?
Are the same unit testing frameworks used for different web frameworks - Rails, Merb, Sinatra, Ramaze and desktop frameworks - Shoes?
And what is the most widely used unit testing framework that would work with all of the various web and desktop frameworks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TestUnit 基于 JUnit,因此可以移植到大多数语言。这可能是最普遍的。
行为驱动测试已经产生了像 RSpec 这样的工具,而且现在看来它可能是 ruby/rails 世界中最流行的测试框架。 (这是一个试图密切关注受欢迎程度的网站:http://ruby-toolbox.com/categories /testing_frameworks.html)
从语法上讲,您需要在这两个大阵营之间做出选择。其中有很多实现,每个都有自己的历史、优点和缺点。即使在 TestUnit 世界中,您也可以抓住“应该”并拥有 RSpec 为您提供的大部分功能。令人困惑,是吗?
大多数工具都没有明确地绑定到框架,并且完全独立于 Rails 工作。
TestUnit is based on JUnit, and so there is port to most languages. This is probably the most ubiquitous.
Behavior driven testing has yielded tools like RSpec, and it seems like right now that may be the most popular test framework in the ruby/rails world. (Here's a site that attempts to keep tabs on popularity: http://ruby-toolbox.com/categories/testing_frameworks.html)
Syntactically you will need to make a choice between those two big camps. Within them, there are lots of implementations, each with their own history, pluses and minuses. Even within the TestUnit world, you can grab "shoulda" and have much of what RSpec gives you. Confusing, eh?
Most of the tools are not explicitly tied to a framework and work fairly independently of Rails.