对于不同类型的 Ruby 应用程序来说,最常用的单元测试框架是什么?

发布于 2024-08-05 09:11:28 字数 119 浏览 1 评论 0原文

不同的 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 技术交流群。

扫码二维码加入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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文