Skip to content
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

Alena's Ride Share #29

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

Alena's Ride Share #29

wants to merge 61 commits into from

Conversation

Spatterjaaay
Copy link

Ride Share

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a design decision you had to make when working on this project. What options were you considering? What helped you make your final decision? One of the design questions I thought about a lot was where to raise an error and were simply allow the code to return an empty result (or nil). I was also considering whether I should raise ArgumentErrors or create my own types of errors that would be more descriptive. In the end I followed the suggestion from our textbook and whenever I would get no result, I'd let the no result be passed (for example, where it would not find trips for a rider that exists), and I'd raise an error only in cases where a method was given an invalid argument.
Describe a concept that you gained more clarity on as you worked on this assignment. I gained more clarity on how the designing process works and how methods interact with each other across classes.
Describe a nominal test that you wrote for this assignment. For the instance method driver (in class Trip) I checked whether the the method returns and instance of the Driver class.
Describe an edge case test that you wrote for this assignment. For the same method I also checked if it returns nil in case the driver for that one trip doesn't exist.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? At first it was difficult to break from the habit of starting to type code immediately, even if just testing, but ultimately it was amazingly helpful. I got a better idea of what the overall goal of the program is, how methods interact across classes and, most importantly, what the output of each method actually is.

@CheezItMan
Copy link

Ride Share

What We're Looking For

Feature Feedback
Baseline
Used Git Regularly Lots of Commits, good work!
Answer comprehension questions You're absolutely right on the use of exceptions. I'm glad pseudo-coding helped as well
Driver
Uses the all method in the find method nicely done, good use of enumerable too!
Has appropriate edge-case tests for each method in the class Good work on edge-case tests
Created a method that uses a method from the Trip object to retrieve the list of trips Check
Created a method that uses the internal trips list to calculate the average rating Well done & good use of Enumerable
Rider
Uses the all method in the find method Check
Has appropriate edge-case tests for each method in the class Check
Created a method that uses a method from the Trip object to retrieve the list of trips Check
Created a method that uses the internal trips method to retrieve the associated drivers Check
Trip
Reads the CSV file in the all method Check
Has appropriate edge-case tests for each method in the class Check
Created a method that uses a method from the Driver to retrieve the associated driver instance Check
Created a method that uses a method from the Rider to retrieve the associated rider instance Check
Created a method to retrieve all trips by driver id Check
Created a method to retrieve all trips by rider id Check & good use of enumerables

Summary

Very well done, good use of Enumerable & excellent job with nominial & edge-case testing.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small note

it "Returns a correct number of drivers for a specific rider" do
rider = Rider.new(41, "Ms. Westley Pouros", "133.000.1809 x9028")
rider.list_drivers.length.must_equal 2
rider.list_drivers.length.wont_equal rider.list_trips.length

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this always be the case?

It's possible, given a different file that this test could fail.

it "Allows rating only within acceptable range (1 - 5)" do
proc {
Trip.new(12, 21, 382, "2016-01-04", 0)
}.must_raise InvalidRatingError

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about negative ratings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants