1

Ruby 单元测试框架中是否有内置的 UI 支持?我可以在 UI 中显示单元测试的结果吗?

4

3 回答 3

1

在 ruby​​ 1.8 中, test/unit 显然支持几个不同的运行器。

ruby test/test_my_app.rb --help

Test::Unit automatic runner.
Usage: test/test_my_app.rb [options] [-- untouched arguments]

    -r, --runner=RUNNER              Use the given RUNNER.
                                     (c[onsole], f[ox], g[tk], g[tk]2, t[k])
[snip rest of help]

对于 ruby​​ 1.9,您可能需要安装 test/unit gem 版本才能获得等效版本。

于 2010-08-03T00:14:43.037 回答
0

不,我可能会使用 Cucumber (www.cukes.info) 和 capybara(用于 Web 浏览器 UI)。

于 2010-08-02T01:16:06.787 回答
0

No, AFAIK, there is no Ruby unit testing framework that has support for GUI built in.

That's not how it normally works, anyway. Usually, it's the GUIs that support testing frameworks, not the other way round. And in fact, most Ruby GUI IDEs (and some non-GUI IDEs, and GUI non-IDEs as well) support at least test/unit and RSpec. Examples include the NetBeans, Eclipse, IDEA and Visual Studio Ruby plugins, Emacs and TextMate.

于 2010-08-02T05:30:06.263 回答