Queues - Cynthia Cobb - Ride Share - #34
Conversation
…s method all are written
…plemented specs for Trip class method find_by_rider
… is an array (not going to read csv file from the Trip class
…bad data to the all method (which initializes all the instances at this point in the program)
…empty nested arrays
…of data to all and find instead of the csv file
…the dependency between classes - going to now fully embrace the dependencies
…nt have any corresponding trip or driver instances
…ile paths as their full path
…r & have specs passing
Ride ShareWhat We're Looking For
Great job! Code is clear and readable, tests cover everything I was looking for, and git habits look solid. Keep up the good work! |
| name | ||
| end | ||
|
|
||
| def self.test_for_vin(vin) |
There was a problem hiding this comment.
Good work abstracting this logic out to its own method. This makes the code easier to read, and easier to update in the future (for example, if you needed to introduce more checks on what a VIN is).
|
|
||
| describe "Driver" do | ||
|
|
||
| describe "Driver#initialize" do |
There was a problem hiding this comment.
Good organization - the nested describes make this code much easier to read.
|
|
||
| @bad_data = { | ||
| bad_id: [['2', 'Emory Rosenbaum', '1B9WEX2R92R12900E'], ['ten', 'name', 'WBWSS52P9NEYLVDE9']], | ||
| bad_vin: [['10', 'name', 'WBWSS52P9NE']], |
There was a problem hiding this comment.
Good organization here. Very obvious why various combos are bad.
Side note: doesn't bad_vin also have a bad ID (since it's a string)? Does this invalidate your test?
| require 'csv' | ||
| #this class creates a FileData object which is an object that has csv_file and | ||
| # you can call read method(s) on this object | ||
| class FileData |
There was a problem hiding this comment.
I like the idea of moving all this to its own class. You might be particularly interested in the last part of the FarMar live code video at https://adaacademy.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=2c336ca7-b2a8-4a78-941b-cd297639b17d
| driver_know_avg.calculate_average_rating.must_equal 2.73 | ||
| end | ||
|
|
||
| it "returns nil if there are no trips for driver" do |
There was a problem hiding this comment.
Good test case! Edge cases like this, asking what happens when there isn't any data, can be easy to miss.
Ride Share
Congratulations! You're submitting your assignment!
Comprehension Questions