Copy unit tests from Ruby 1.9