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.

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

  1. SM says:

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

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s