Time - Denisse & Yaz#20
Open
denisseai wants to merge 9 commits into
Open
Conversation
…om_csv and added test in Trip#initialize to check for valid start and end Time objects
…ds. Added class driver, updated methods in TripDispatcher, Trip to reflect new class Driver.
…l be made by request_trip
OO Ride ShareMajor Learning Goals/Code Review
Testing Requirements
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
beccaelenzil
left a comment
There was a problem hiding this comment.
Great work overall. It is clear the learning goals around TDD, object composition, and inheritance were met. You did a particularly nice job breaking down complex functionality using helper methods. Keep up the hard work!
| def request_trip(passenger_id) | ||
| driver = drivers.find {|driver| driver.status == :AVAILABLE } | ||
| if driver == nil | ||
| raise NoDriverError.new("No available drivers for this trip.") |
| driver_id: driver.id | ||
| ) | ||
| trips << new_trip | ||
| driver.request_trip(new_trip) |
|
|
||
| # Calculate passenger's total time spent on trips | ||
| def total_time_spent | ||
| total_duration = trips.sum {|trip| trip.duration} |
| it "returns 0 when trips is empty array" do | ||
| expect(@passenger.total_time_spent).must_equal 0 | ||
| end | ||
|
|
There was a problem hiding this comment.
These tests look good. You should test for one more edge case when the passenger has in progress trip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assignment Submission: OO Ride Share
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection