Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def random_select(array, n)
- result = []
- numbers = n.times.map{ Random.rand(array.length) }
- numbers.each do |x|
- result << array[x]
- end
- result
- end
- error message :
- Makes a call to 'rand' or 'Array#shuffle'RSpec::Expectations::ExpectationNotMetErrorexpected false to be true
Advertisement
Add Comment
Please, Sign In to add comment