mattsears/nyan-cat-formatter — pull request #25 by rewinfrey (2012-07-17 09:35:23+00:00)
Title: Play Nyan Cat song while running specs

Hello,

This is an attempt to play the Nyan Cat song while using the nyan-cat-formatter to run specs. I can only test this on OSx, but I added a conditional check using the RUBY_PLATFORM environmental constant to verify if the host's operating system is OSx.

You'll see there is a file added to the repo: ".nyan-cat.mp3" that is to be added to the host's home directory.

When specs are first run, a simple check to determine if the operating system is OSx and that the .nyan-cat.mp3 file exists in the host's home directory. If both conditions are true, then the OSx native `afplay` system command is executed as a background process. Once the specs are finished and the `dump_summary` method is called, a rather crude `killall -9 afplay` system command is called to end the song (assuming that both of the original conditions are satisfied).

Thanks for putting this together! I really love running specs now ^___^