Fix unit tests for Ruby 1.8

Change-Id: I9263a014d1d9d727aa262840678c884fc5e10ebc