I’d like to know how much took to run the 10 most time consuming tests.. like I can do with rspec, any suggestion?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short answer:
Ruby 1.9 use
MiniTestas its default testing framework instead ofTest::Unit. MiniTest is smaller, faster, has more useful features, and is largely backward compatible with Test::Unit. One of those newer features is measuring the time each test takes with the-vflag. When you run the e sure you place this flag after the scriptIf, as in rails, you use
Rake::TestTaskto run your tests, you’ll can either specify it at runtime by runningor specify it in the task by adding
-vto theoptionsattribute, like soFinally, if you’re using rails and MiniTest just isn’t good enough for you, you might appreciate the
test_benchmarkplugin. Usage is easy. Add the following line to yourconfig/environments/test.rbInstall it with
From then on, you’ll get a nice sorted list when you run your tests
I’m sorry to say that
MiniTestand thetest_benchmarkplugin are incompatible with each other, but I strongly encourage you to tryMiniTest, since it’ll make your tests faster, and will continue to be supported in Ruby 1.9.