I do not understand them on this way :

Makes a call to 'rand' or 'Array#shuffle'
RSpec::Expectations::ExpectationNotMetError expected false to be
true

I do use rand. See here :  numbers = n.times.map{ 
Random.rand(array.length) }


returns only the values present in the array passed to the method
RSpec::Expectations::ExpectationNotMetError expected [902, 467,
807, 569] to include 0

I do that. I looked how many numbers there are. choose 2 numbers of it 
by thier index.
and why schould it include 0 in a array which not contains 0.

Roelof


Roelof Wobben schreef op 21-6-2014 16:10:
> I know that and there are not mine expectations but of the site 
> rubymonkey
>
> Roelof
>
>
>
> Rylee Fowler schreef op 21-6-2014 16:04:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA512
>>
>> These are RSpec issues. Something in your test suite is not meeting
>> expectations.
>>
>> On 6/21/2014 09:01, Roelof Wobben wrote:
>>> Hello,
>>>
>>> I have this :
>>>
>>> def random_select(array, n) numbers = n.times.map{
>>> Random.rand(array.length) } numbers.each do |x| puts array[x] end
>>> end
>>>
>>>
>>> but I see these error messages:
>>>
>>> Makes a call to 'rand' or 'Array#shuffle'
>>> RSpec::Expectations::ExpectationNotMetError expected false to be
>>> true
>>>
>>> returns only the values present in the array passed to the method
>>> RSpec::Expectations::ExpectationNotMetError expected [902, 467,
>>> 807, 569] to include 0
>>>
>>> Can someone explain both to me ?
>>>
>>> Roelof
>>>
>>>
>> - -- Rylee Fowler
>> rylee / rylee.me
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v2.0.22 (MingW32)
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>
>> iQEcBAEBCgAGBQJTpZEIAAoJEAWmNCH2N+MzEOgH/is5GqlIsZKME+WFShQQeSSU
>> rx/f8hmd/TtIbPRBDZPQCTBsuYhl/Rqc4m1gnZE4rN+43OrIiYc3/vQtnylADJ9i
>> mZDgX/5Mpr/cYqf9uAGG0JWwnYYuO3wl0THXrI4V6Qs2hmiAC6CWIDgipRRlxGdt
>> UUqhnvQ4Gt6HO9laOfo3iHQhNydDhwSIa2B4eXhvRwtL3aI/ouw+80G65QKxKFr4
>> /mvcaU/3imRhPs42q2F6Jxe2QmJhmYHOUyGmiisaJIdhv0dqYEE6J3XAEeaasARA
>> ovdgzpUyZUcGXMY9qMEUU5F5NeMwlH/gjozWB440lbSO0U3nubjbG9EYw0czfh8=
>> =WPM1
>> -----END PGP SIGNATURE-----
>>
>
>