TheOdinProject / curriculum

The open curriculum for learning web development
https://www.theodinproject.com/
Other
9.08k stars 12.57k forks source link

Added hash map tests for Ruby #28263

Closed elishamutang closed 6 days ago

elishamutang commented 1 week ago

Because

Allows users to populate their hash maps where it will exceed their load factor and ensuring that their hash map methods will still work as expected after growing their buckets (similar to this PR for JavaScript course).

This PR

Added a new section to test out user hash map implementation after Assignment section. Added dummy nodes to populate user hash map in the new section.

Issue

Closes #28257

Additional Information

Pull Request Requirements

SumonGFC commented 1 week ago

Hello :p Small gripe: In ruby style conventions, the names of "predicate methods" (methods that return a boolean) should end with a question mark to indicate that they return booleans. So on lines 52 and 109 in your proposed changes, #has(key) should be named #has?(key). just wanted to let you know.

elishamutang commented 1 week ago

@SumonGFC Ah i see, didn't know that. Thanks for letting me know, I'll undo that change! What about the the set method in lines 44 & 48?

SumonGFC commented 1 week ago

@elishamutang those lines are perfect. This set method is not supposed to return a boolean in the interface described by this project (think it is supposed to return the value that is associated with the key)

So #has?(key) is the only method that should have the question mark on the end

elishamutang commented 6 days ago

@JoshDevHub totally missed that last #has method haha. No worries and thanks for the help! You too @SumonGFC :)