minitest, test::unit, and rails

…衆ロ難τιáo~ 提交于 2019-12-01 02:06:25

There is a Test::Unit "compatibility" module that comes with Minitest, so that you can (presumably) use your existing Test::Unit tests as-is. This is probably the Test::Unit module you are seeing.

As of rails 3.2.3, generator-created tests include rails/test_help which includes test/unit.

The test "something" do syntax is a rails extension. It's defined in ActiveSupport::Testing::Declarative, which is require'd by rails/test_help.

This is perhaps a bit of a tangential response, but as to your rspec comment... You might want to take a look at minitest/spec which provides spec flavor syntax in stdlib in 1.9.x.

http://bfts.rubyforge.org/minitest/MiniTest/Spec.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!