I Love Ruby! Part 1 of ∞? 10.times, run my tests

I had an integration test suite and thought “hmm, I’d like to run rake test ten times and study the logs and New Relic montoring results”. A few seconds later

~/myproject(master) $ ruby -e "10.times { puts \`rake test\` }"

and why not print out the local execution time as well?

~/myproject(master) $ time ruby -e "10.times { puts \`rake test\` }"

real 1m18.268s
user 0m33.873s
sys 0m11.305s

nifty? Now I can locate the slower parts of the app and improve them!

edit: You might like this better?

~/myproject(master) $ time ruby -e "10.times { system('rake test') }"

If you’re a programmer and don’t use a proper command line tool, you’re being an idiot. You’re probably not an idiot, so get a terminal now (windows: i.e use cygwin ). I’d wanted to say you’re an idiot for developing on windows, but then I remembered, nobody in their right minds would choose windows themselves, they’re all victims of corporate standards. What a pity. ;)


About Ole Morten Amundsen

Developer, programmer, entrepreneur. Java, .Net, ruby, rails, agile, lean. Opinionated enthusiast!
This entry was posted in agile, ruby, smidig and tagged , . Bookmark the permalink.

2 Responses to I Love Ruby! Part 1 of ∞? 10.times, run my tests

  1. SM says:

    you’re a funny programmer :)
    keep posting those articles.

  2. Madelyn Mccalpane says:

    This website is completely awesome. I’ve ask these informations a
    great deal and I realised that is good written, fast to comprehend.
    I congratulate you because of this article that I
    am going to recommend to prospects around. I ask you to recommend the gpa-calculator.co site
    where each pupil or university student can calculate results grade point average
    marks. All good!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s