(maint) Replace use Array#sample with Array#shuffle

Ruby 1.8.7 doesn't have an Array#sample method (it does have
Array#choice, which was removed in 1.9.x) so tests failed. That method
has been replaced with the more verbose Array.shuffle.first technique.