Skip to content

Conversation

jack-chester
Copy link

@jack-chester jack-chester commented Jun 5, 2017

expect(a_hash.empty?).to be true
end
end

context "on loops, yeah!!!" do
it "should loop over the array and return a new array" do
loopy = [1,2,3]
expect(loopy._fill_in_method_here_ { |n| n + 1 }).to eq [2,3,4]
expect(loopy.collect { |n| n + 1 }).to eq [2,3,4]
Copy link
Member

@mikegee mikegee Jun 16, 2017

Choose a reason for hiding this comment

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

map is typically preferred over collect. (They are aliases.)

@mikegee
Copy link
Member

mikegee commented Jun 16, 2017

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants