Wouldn't this peg the CPU and possibly starve the thing you're waiting for?
Good point. Needs to take a nap in the loop. Updated.
@mattwynne Looks like there is a syntax error on line 6 with the colon.
@mitchlloyd https://gist.github.com/justinrolston/6974426/12b41c682f83a75c8c93c0a8242e7b8813e802e7#file-gistfile1-txt resolves line 6
Stumbled across this, and realised that the gist no more works since rspec expectation failure now subclasses from Exception rather than StandardError (rspec/rspec-expectations@eafa55d#diff-f14d34de26325e61579baa36128c97cb)
Here's a fork that rescues both StandardError and RSpec::Expectations::ExpectationNotMetError: