Fix test failure for ruby 1.8
Merge pull request #9226 from robertomiranda/fix-bigdecimal-test

[3.1] Fix test failure for ruby 1.8