Fix unit test failures with ruby 1.8.7

rspec with 1.8.7 seems to be having issues with trailing commas and
unescaped '{' or '}' within the %r{} block.