Time - Sharon and Jocelyn#1
Conversation
…y adding passenger/driver)
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 assignment. I've left a few inline comment for you to review, mostly giving you kudos for your use of enumerable methods :). It is clear that the learning goals around TDD, object composition, and inheritance were met. Keep up the hard work!
|
|
||
| def total_time_spent | ||
| return 0 if @trips == [] | ||
| @trips.map {|trip| trip.duration() }.inject(:+) |
|
|
||
| describe "net_expenditures" do | ||
| # You add tests for the net_expenditures method | ||
| describe "net_expenditures and total time spent" do |
There was a problem hiding this comment.
I know these methods are quite similar, but they still should be tested in different it blocks.
| @trips << trip | ||
| end | ||
|
|
||
| def average_rating |
There was a problem hiding this comment.
Nice use of enumerable methods, again :)
| end | ||
|
|
||
|
|
||
| def request_trip(passenger_id) |
| counter = nil | ||
| max_time = Time.now() | ||
| self.drivers.each_with_index do |driver, index| | ||
| if driver.status == :AVAILABLE |
There was a problem hiding this comment.
It seems that you implemented some of the optionals for wave 3 (nice work!), but I don't see tests corresponding to these rules. In addition, the mix of a post-fix conditional and a standard conditional, nested in another conditional, makes this a little tricky to read. Consider breaking out into helper methods to increase readability.
Assignment Submission: OO Ride Share
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection