require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Array do it "should define rand, a way to get a random variable from an array" do a = [1,2] a.should be_include(a.rand) # 9.31322574615479e-10 chance of failing 30.times.map {a.rand}.uniq.sort.should eql([1,2]) end end