Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array#random #12

Merged
merged 1 commit into from
Sep 8, 2015
Merged

Array#random #12

merged 1 commit into from
Sep 8, 2015

Conversation

darthjee
Copy link
Contributor

@darthjee darthjee commented Sep 8, 2015

The method returns a random element from the array

(0..2).each do |index|
context "when random returns #{index}" do
before do
allow_any_instance_of(Array).to receive(:rand).with(array.size) { index }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stubar o rand é osso hahaha, era melhor n testar

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

não vi outro jeito :(

@thiagogsr
Copy link

:shipit:

darthjee added a commit that referenced this pull request Sep 8, 2015
Adição do método random para array
@darthjee darthjee merged commit b61d9a1 into master Sep 8, 2015
@darthjee darthjee deleted the ff-random branch September 8, 2015 21:27
@darthjee darthjee changed the title Adição do método random para array Array#random Sep 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants