Conversation
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 on this project. The comprehensiveness of your tests is particularly notable. I've left a few in line comments for you to consider, but it is clear that the learning goals around TDD, object composition, and inheritance were met. Keep up the hard work!
| end | ||
|
|
||
| def duration | ||
| if end_time != nil |
There was a problem hiding this comment.
Nice work handling in progress trips across the board (especially testing for this edge case!). I'm not sure if this would make sense with the rest of your implementation, but you might consider whether raising an exception instead of returning a string could work for in progress trips.
| expect(@passenger.total_time_spent).must_equal 4500 | ||
| end | ||
|
|
||
| it "Returns 0 if passenger has no trips" do |
There was a problem hiding this comment.
Great work testing for these 2 edge cases
| end | ||
|
|
||
| def total_revenue | ||
| valid_costs = @trips.reject{|trip|trip.cost == nil} |
| end | ||
| end | ||
|
|
||
| raise NoDriverError.new("Sorry! There are no available drivers. Please request a new trip.") if driver == nil |
| driver = nil | ||
| oldest_endtime = Time.now | ||
|
|
||
| available_drivers.each do |indiv_driver| |
There was a problem hiding this comment.
Good work implementing this logic. You may consider encapsulating this logic in a helper method.
| end | ||
| end | ||
|
|
||
| describe "request_trip(passenger_id)" do |
There was a problem hiding this comment.
Nice work writing comprehensive tests for this method.
Assignment Submission: OO Ride Share
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection