forked from AdaGold/oo-ride-share
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Queues - Cara Comfort - RideShare 2 #35
Open
cecomfort
wants to merge
36
commits into
Ada-C7:master
Choose a base branch
from
cecomfort:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7,399
−4
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
03f5be1
Content added to Rakefile
cecomfort bc22c1c
Added driver file
cecomfort 43dfc31
Added trip file
cecomfort 1a6be89
Added rider file
cecomfort 5ec6a96
Added spec files for classes
cecomfort f2a2db0
Past first initialize test for Driver
cecomfort 288b9bc
Added spec_helper to spec files
cecomfort 63d03c6
Driver -> takes a name, VIN, and ID
cecomfort a959e5f
Added InvalidVinError class
cecomfort 8ca1d89
driver raises InvalidVinError for invalid vin
cecomfort a43a90a
Outlined rest of Driver spec tests
cecomfort c9e26fc
Driver.all returns an array
cecomfort ee1ce68
Driver.all returns array of driver objs
cecomfort 2a2eaaf
Driver.all returns the correct number of drivers
cecomfort 0eef503
completed Driver.all and Driver.find
cecomfort e85e321
Rider -> constructor tests
cecomfort 7831a08
Rider -> initialize defined
cecomfort 687b478
Rider -> outlined spec tests
cecomfort c327831
Rider -> self.all
cecomfort 64b27d3
Rider -> Rider.find complete
cecomfort 6dcb373
Trip -> can be instantiated with args
cecomfort ef610b1
Trip -> rating must be an int
cecomfort 37a20e5
Renamed invalid_vin_error to custom_errors
cecomfort 012b804
Cutom_errors -> defined invalid rating error
cecomfort 35a531c
Driver -> VIN must be a string
cecomfort 107a568
Trip-> driver method complete
cecomfort 64939a4
Trip -> rider method complete
cecomfort 59ab5bb
Trip -> self.all complete
cecomfort 951d3e9
Trip -> find_all_for_driver returns an array of Trips
cecomfort 313952a
Trip -> find_all_for_driver returns correct trips from csv file
cecomfort 507183c
Trip -> find_all_for_rider complete
cecomfort 34f25cc
Driver -> Trips method complete
cecomfort c177ebd
Rider -> Trips method compelte
cecomfort bc09482
Driver -> avg rating complete
cecomfort aa7ad95
Rider -> wrote tests for drivers method
cecomfort 40e09d3
Rider -> drivers method complete
cecomfort File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Outlined rest of Driver spec tests
commit a43a90aa46315ade8d2cdc52fe357a48db7d53e0
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ def initialize(args) | |
@vin = args[:vin] | ||
end | ||
|
||
|
||
|
||
|
||
private | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,6 @@ | ||
require_relative 'spec_helper' | ||
|
||
describe "Driver" do | ||
# describe "constructor" do | ||
# let (:driver) {RideShare::Driver.new(name: 'Ada', id: 108, vin: '123456789abcdefeg')} | ||
# | ||
# it "can be instantiated" do | ||
# driver.must_be_instance_of RideShare::Driver | ||
# end | ||
# | ||
# it "takes a name, VIN, and ID" do | ||
# driver.must_respond_to :name | ||
# driver.name.must_equal 'Ada' | ||
# | ||
# driver.must_respond_to :id | ||
# driver.id.must_equal 108 | ||
# | ||
# driver.must_respond_to :vin | ||
# driver.vin.must_equal '123456789abcdefeg' | ||
# end | ||
# | ||
# it "raises an error if the VIN is not 17 characters long" do | ||
# invalid_vin = '123456dfsd' | ||
# | ||
# proc { | ||
# RideShare::Driver.new(name: 'Ada', id: 108, vin: invalid_vin) | ||
# }.must_raise ArgumentError | ||
# end | ||
# | ||
# it "raises an error if the VIN has a character other than a letter or number" do | ||
# invalid_vin = '12345!!12345ddegd' | ||
# | ||
# proc { | ||
# RideShare::Driver.new(name: 'Ada', id: 108, vin: invalid_vin) | ||
# } | ||
# end | ||
# end | ||
|
||
describe "constructor" do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good organization - the nested |
||
before do | ||
@name = 'Ada' | ||
|
@@ -77,4 +42,68 @@ | |
}.must_raise RideShare::InvalidVinError | ||
end | ||
end | ||
|
||
describe "trips" do | ||
it "returns an array" do | ||
skip | ||
end | ||
|
||
it "returns an array with only Trip objects" do | ||
|
||
end | ||
|
||
it "returns Trips that only THIS driver has taken" do | ||
|
||
end | ||
end | ||
|
||
describe "avg_rating" do | ||
it "returns a float to 1 decimal point" do | ||
|
||
end | ||
|
||
it "returns the overall avg_rating for a driver" do | ||
#test decimal point | ||
end | ||
end | ||
|
||
describe "Driver.all" do | ||
# need to isolate opening CSV in own method/class variable? | ||
# rescue CSV? | ||
|
||
it "returns an array" do | ||
|
||
end | ||
|
||
it "returns an array with only Driver elements" do | ||
|
||
end | ||
|
||
it "returns all drivers in the CSV file" do | ||
# [d1,d2,d3,d4].length = x | ||
# &/or [d1, d2, d3] = expected_array | ||
end | ||
end | ||
|
||
describe "Driver.find" do | ||
# return nil or raise error if search isnt found? | ||
|
||
# def find_and_verify private method | ||
|
||
it "returns an account that exists" do | ||
|
||
end | ||
|
||
it "can find the first Driver from the CSV file" do | ||
|
||
end | ||
|
||
it "can find the last Driver from the CSV file" do | ||
|
||
end | ||
|
||
it "returns nil if driver_id is not found" do | ||
# or raises an error | ||
end | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Good use of
private
to hide methods not part of your API.