minitest, test::unit, and rails

前端 未结 2 675
北海茫月
北海茫月 2021-01-07 17:03

I read somewhere that \'minitest\' is the \"new test::unit for ruby 1.9.2+\".

But ruby 1.9.3 seems to include both test::unit and minitest, is tha

相关标签:
2条回答
  • 2021-01-07 17:20

    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

    0 讨论(0)
  • 2021-01-07 17:38

    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.

    0 讨论(0)
提交回复
热议问题