【发布时间】:2012-05-13 17:53:16
【问题描述】:
我在某处读到“minitest”是“ruby 1.9.2+ 的新测试::unit”。
但是 ruby 1.9.3 似乎包含 both test::unit 和 minitest,是这样吗?
在默认的 Rails 测试中,如Rails testing guide.... 中所述,ActiveSupport::TestCase、ActionController::TestCase 之类的东西是使用Test::Unit 还是Minitest?
在 rails 指南中,它显示了测试定义如下的示例:
test "should show post" do
get :show, :id => @post.id
assert_response :success
end
test string 的语法与使用 test_something 之类的名称定义方法相反——在 Test::Unit 或 Minitest 的文档中都没有提及。那是从哪里来的? Rails 是在添加它,还是它实际上是...任何测试 lib rails 正在使用的一部分?
PS:请不要告诉我“只使用 rspec”。我知道rspec。我正在尝试在 rails 的上下文中探索 stdlib 的替代方案。
【问题讨论】:
标签: ruby-on-rails ruby testunit minitest