-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oo-ride-share-maryam-kay #22
base: master
Are you sure you want to change the base?
Conversation
…ded 2 tests for it
…sts creating valid Driver, valid VIN, and valid ID
…river add_driven_trip()modified
…exception in find_driver_by_availability method
…ted tests passing
Ride ShareWhat We're Looking For
|
|
||
expect(driver).must_be_instance_of RideShare::Driver | ||
|
||
expect(driver.trips).must_include trip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not passing, the expectation should read:
expect(driver.driven_trips).must_include trip
Also see my note in TripDispatcher
} | ||
|
||
trip = Trip.new(parsed_trip) | ||
passenger.add_trip(trip) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also have:
driver.add_driven_trip(trip)
end | ||
end | ||
it "establishes the base data structures when instantiated" do | ||
dispatcher = RideShare::TripDispatcher.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have the files used for testing in the arguments to new
dispatcher = RideShare::TripDispatcher.new(USER_TEST_FILE,
TRIP_TEST_FILE, DRIVER_TEST_FILE)
driven_trips.each do |trip| | ||
all_ratings << trip.rating | ||
end | ||
return average = (all_ratings.sum / all_ratings.length).to_f.round(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need average
you could simply:
return (all_ratings.sum / all_ratings.length).to_f.round(1)
end | ||
|
||
def net_expenditures | ||
return (super - total_revenue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
expect(before_new_trip < after_new_trip).must_equal true | ||
end | ||
|
||
it "makes sure driver is not driving themself " do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add one test where there is one driver available and that driver requests a trip.
OO Ride Share
Congratulations! You're submitting your assignment!
Comprehension Questions
User
andDriver