Bug #455: Array#sample(n) loops if a > arr.size
http://redmine.ruby-lang.org/issues/show/455

Author: Dave Thomas
Status: Open, Priority: Normal
Category: core

Try:

[1].sample(2)


----------------------------------------
http://redmine.ruby-lang.org