From d5cfce3151ca3636e66d8c0ab585f2fe6c76393d Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Fri, 13 Dec 2024 18:17:29 -0600 Subject: [PATCH 01/14] All tests passing through iteration 1 requirements --- Gemfile.lock | 1 + lib/dmv.rb | 3 ++- lib/facility.rb | 15 ++++++++------ lib/registrant.rb | 23 +++++++++++++++++++++ lib/vehicle.rb | 5 +++++ spec/registrant_spec.rb | 44 +++++++++++++++++++++++++++++++++++++++++ spec/spec_helper.rb | 1 + 7 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 lib/registrant.rb create mode 100644 spec/registrant_spec.rb diff --git a/Gemfile.lock b/Gemfile.lock index d273a79f9..9546e6b0b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,6 +29,7 @@ GEM PLATFORMS arm64-darwin-20 arm64-darwin-21 + arm64-darwin-23 DEPENDENCIES faraday diff --git a/lib/dmv.rb b/lib/dmv.rb index f9e59bdf3..3b3c2f2e8 100644 --- a/lib/dmv.rb +++ b/lib/dmv.rb @@ -1,4 +1,5 @@ class Dmv + attr_reader :facilities def initialize @facilities = [] @@ -9,7 +10,7 @@ def add_facility(facility) end def facilities_offering_service(service) - @facilities.find do |facility| + @facilities.find_all do |facility| facility.services.include?(service) end end diff --git a/lib/facility.rb b/lib/facility.rb index a65757687..afe98d993 100644 --- a/lib/facility.rb +++ b/lib/facility.rb @@ -1,14 +1,17 @@ class Facility - attr_reader :name, :address, :phone, :services + attr_reader :name, + :address, + :phone, + :services - def initialize(name, address, phone) - @name = name - @address = address - @phone = phone + def initialize(facility_details) + @name = facility_details[:name] + @address = facility_details[:address] + @phone = facility_details[:phone] @services = [] end - def add_services(service) + def add_service(service) @services << service end end diff --git a/lib/registrant.rb b/lib/registrant.rb new file mode 100644 index 000000000..e1e51fc9d --- /dev/null +++ b/lib/registrant.rb @@ -0,0 +1,23 @@ +require 'pry' + +class Registrant + attr_reader :name, + :age, + :permit, + :license_data + + def initialize(name, age, license_data, permit = false) + @name = name + @age = age + @license_data = license_data + @permit = permit + end + + def permit? + @permit = permit + end + + def earn_permit + @permit = true + end +end \ No newline at end of file diff --git a/lib/vehicle.rb b/lib/vehicle.rb index 49ae83672..caa9f069d 100644 --- a/lib/vehicle.rb +++ b/lib/vehicle.rb @@ -6,6 +6,7 @@ class Vehicle :make, :model, :engine + def initialize(vehicle_details) @vin = vehicle_details[:vin] @@ -22,4 +23,8 @@ def antique? def electric_vehicle? @engine == :ev end + + def registration_date + + end end diff --git a/spec/registrant_spec.rb b/spec/registrant_spec.rb new file mode 100644 index 000000000..233b108dd --- /dev/null +++ b/spec/registrant_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +RSpec.describe Registrant do + before(:each) do + @registrant_1 = Registrant.new("Bruce", 18, {:written =>false, :license => false, :renewed => false}, true) + @registrant_2 = Registrant.new("Penny", 15, {:written =>false, :license => false, :renewed => false}) + end + + describe 'initialize'do + it 'can initialize' do + expect(@registrant_1). to be_an_instance_of(Registrant) + expect(@registrant_2). to be_an_instance_of(Registrant) + end + end + + describe 'registrant data' do + it 'can store names'do + expect(@registrant_1.name). to eq("Bruce") + expect(@registrant_2.name). to eq("Penny") + end + + it 'can store ages' do + expect(@registrant_1.age).to eq(18) + expect(@registrant_2.age).to eq(15) + end + + it 'can tell if they have a permit'do + expect(@registrant_1.permit?). to eq(true) + expect(@registrant_2.permit?). to eq(false) + end + + it 'can pull license data'do + expect(@registrant_1.license_data).to eq({:written =>false, :license => false, :renewed => false}) + expect(@registrant_2.license_data).to eq({:written =>false, :license => false, :renewed => false}) + end + + it 'can let registrants earn permit'do + @registrant_2.earn_permit + expect(@registrant_2.permit?).to eq(true) + end + end + + +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 928255386..58d13198f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,3 +3,4 @@ require './lib/facility' require './lib/vehicle' require './lib/dmv_data_service' +require './lib/registrant' From e7228950afcb0ad886ddd515498cb3dc1ae76bce Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Sat, 14 Dec 2024 14:07:05 -0600 Subject: [PATCH 02/14] Halfway through iteration 2 testing and methods --- lib/facility.rb | 24 ++++++++++++++++- lib/vehicle.rb | 18 +++++++++++-- spec/facility_spec.rb | 63 +++++++++++++++++++++++++++++++++++-------- spec/vehicle_spec.rb | 16 ++++++++++- 4 files changed, 106 insertions(+), 15 deletions(-) diff --git a/lib/facility.rb b/lib/facility.rb index afe98d993..3fb285bd0 100644 --- a/lib/facility.rb +++ b/lib/facility.rb @@ -1,17 +1,39 @@ +require 'pry' class Facility attr_reader :name, :address, :phone, - :services + :services, + :registered_vehicles, + :collected_fees def initialize(facility_details) @name = facility_details[:name] @address = facility_details[:address] @phone = facility_details[:phone] @services = [] + @registered_vehicles = [] + @collected_fees = 0 end def add_service(service) @services << service end + + def register_vehicle(vehicle) + + if @services.include?('Vehicle Registration') + @registered_vehicles << vehicle + vehicle.registration_date + end + + if vehicle[:year] < 1999 + @collect_fees += 25 + elsif vehicle[:engine] == ev + @collect_fees += 200 + else + @collect_fees += 100 + end + end + end diff --git a/lib/vehicle.rb b/lib/vehicle.rb index caa9f069d..6f1083f3d 100644 --- a/lib/vehicle.rb +++ b/lib/vehicle.rb @@ -5,7 +5,9 @@ class Vehicle :year, :make, :model, - :engine + :engine, + :registration_date, + :plate_type def initialize(vehicle_details) @@ -14,6 +16,7 @@ def initialize(vehicle_details) @make = vehicle_details[:make] @model = vehicle_details[:model] @engine = vehicle_details[:engine] + @plate_type = plate_type end def antique? @@ -24,7 +27,18 @@ def electric_vehicle? @engine == :ev end - def registration_date + def register + @registration_date = Date.today + + if antique? + @plate_type = :antique + elsif electric_vehicle? + @plate_type = :ev + else + @plate_type = :regular + end end + + end diff --git a/spec/facility_spec.rb b/spec/facility_spec.rb index c0f2f1233..4c24e23e5 100644 --- a/spec/facility_spec.rb +++ b/spec/facility_spec.rb @@ -1,26 +1,67 @@ require 'spec_helper' +require 'pry' RSpec.describe Facility do before(:each) do - @facility = Facility.new({name: 'DMV Tremont Branch', address: '2855 Tremont Place Suite 118 Denver CO 80205', phone: '(720) 865-4600'}) + + @facility_1 = Facility.new({name: 'DMV Tremont Branch', address: '2855 Tremont Place Suite 118 Denver CO 80205', phone: '(720) 865-4600'}) + @facility_2 = Facility.new({name: 'DMV Northeast Branch', address: '4685 Peoria Street Suite 101 Denver CO 80239', phone: '(720) 865-4600'}) + + @cruz = Vehicle.new({vin: '123456789abcdefgh', year: 2012, make: 'Chevrolet', model: 'Cruz', engine: :ice} ) + @bolt = Vehicle.new({vin: '987654321abcdefgh', year: 2019, make: 'Chevrolet', model: 'Bolt', engine: :ev} ) + @camaro = Vehicle.new({vin: '1a2b3c4d5e6f', year: 1969, make: 'Chevrolet', model: 'Camaro', engine: :ice} ) end + describe '#initialize' do + it 'can initialize' do - expect(@facility).to be_an_instance_of(Facility) - expect(@facility.name).to eq('DMV Tremont Branch') - expect(@facility.address).to eq('2855 Tremont Place Suite 118 Denver CO 80205') - expect(@facility.phone).to eq('(720) 865-4600') - expect(@facility.services).to eq([]) + expect(@facility_1).to be_an_instance_of(Facility) + expect(@facility_1.name).to eq('DMV Tremont Branch') + expect(@facility_1.address).to eq('2855 Tremont Place Suite 118 Denver CO 80205') + expect(@facility_1.phone).to eq('(720) 865-4600') + expect(@facility_1.services).to eq([]) + + expect(@facility_2).to be_an_instance_of(Facility) + expect(@facility_2.name).to eq('DMV Northeast Branch') + expect(@facility_2.address).to eq('4685 Peoria Street Suite 101 Denver CO 80239') + expect(@facility_2.phone).to eq('(720) 865-4600') + expect(@facility_2.services).to eq([]) end end describe '#add service' do + it 'can add available services' do - expect(@facility.services).to eq([]) - @facility.add_service('New Drivers License') - @facility.add_service('Renew Drivers License') - @facility.add_service('Vehicle Registration') - expect(@facility.services).to eq(['New Drivers License', 'Renew Drivers License', 'Vehicle Registration']) + expect(@facility_1.services).to eq([]) + @facility_1.add_service('New Drivers License') + @facility_1.add_service('Renew Drivers License') + @facility_1.add_service('Vehicle Registration') + expect(@facility_1.services).to eq(['New Drivers License', 'Renew Drivers License', 'Vehicle Registration']) + end + end + + describe '#add registration details'do + + it 'has a registration date for each car' do + expect(@cruz.registration_date).to eq(nil) end + + it 'has a list of registered vehicles'do + expect(@facility_1.registered_vehicles).to eq ([]) + end + + it 'keeps track of collected fees' do + expect(@facility_1.collected_fees).to eq(0) + end + + it 'can register vehicles'do + @facility_1.add_service('Vehicle Registration') + @facility_1.register_vehicle(@cruz) + expect(@facility_1.registered_vehicles).to eq([@cruz]) + end + + it 'checks that fees are collected when a vehicle is registered' + @facility_1.register_vehicle(@cruz) + expect(@collect_fees).to eq() end end diff --git a/spec/vehicle_spec.rb b/spec/vehicle_spec.rb index 5c7f01184..fcf50b2fa 100644 --- a/spec/vehicle_spec.rb +++ b/spec/vehicle_spec.rb @@ -14,7 +14,7 @@ expect(@cruz.make).to eq('Chevrolet') expect(@cruz.model).to eq('Cruz') expect(@cruz.engine).to eq(:ice) - expect(@cruz.registration_date).to eq(nil) + # expect(@cruz.registration_date).to eq(nil) end end @@ -33,4 +33,18 @@ expect(@camaro.electric_vehicle?).to eq(false) end end + + describe 'registration details'do + it 'can detect registration date'do + @cruz.register + expect(@cruz.registration_date).to eq(Date.today) + end + + it 'can check vehicle plate type'do + @cruz.register + expect(@cruz.plate_type).to eq(:regular) + end + + + end end From 8b9706fc56b9e2188550be844e84afa5cf21bfe7 Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Sat, 14 Dec 2024 15:16:26 -0600 Subject: [PATCH 03/14] 27 tests passing for facility_1 features --- lib/facility.rb | 17 ++++++++++------- spec/facility_spec.rb | 21 ++++++++++++++------- spec/vehicle_spec.rb | 8 ++++++++ 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/lib/facility.rb b/lib/facility.rb index 3fb285bd0..5816cfc6a 100644 --- a/lib/facility.rb +++ b/lib/facility.rb @@ -24,16 +24,19 @@ def register_vehicle(vehicle) if @services.include?('Vehicle Registration') @registered_vehicles << vehicle - vehicle.registration_date end - if vehicle[:year] < 1999 - @collect_fees += 25 - elsif vehicle[:engine] == ev - @collect_fees += 200 + end + + def collect_fee(vehicle) + + if vehicle.year < 1999 + @collected_fees += 25 + elsif vehicle.engine == :ev + @collected_fees += 200 else - @collect_fees += 100 + @collected_fees += 100 end end - + end diff --git a/spec/facility_spec.rb b/spec/facility_spec.rb index 4c24e23e5..d9d384567 100644 --- a/spec/facility_spec.rb +++ b/spec/facility_spec.rb @@ -40,13 +40,13 @@ end end - describe '#add registration details'do + describe '#add registration details' do it 'has a registration date for each car' do expect(@cruz.registration_date).to eq(nil) end - it 'has a list of registered vehicles'do + it 'has a list of registered vehicles' do expect(@facility_1.registered_vehicles).to eq ([]) end @@ -54,14 +54,21 @@ expect(@facility_1.collected_fees).to eq(0) end - it 'can register vehicles'do + it 'can register vehicles' do @facility_1.add_service('Vehicle Registration') @facility_1.register_vehicle(@cruz) - expect(@facility_1.registered_vehicles).to eq([@cruz]) + @facility_1.register_vehicle(@camero) + @facility_1.register_vehicle(@bolt) + expect(@facility_1.registered_vehicles).to eq([@cruz, @camero, @bolt]) end - it 'checks that fees are collected when a vehicle is registered' - @facility_1.register_vehicle(@cruz) - expect(@collect_fees).to eq() + it 'checks that fees are collected when a vehicle is registered' do + @facility_1.collect_fee(@cruz) + @facility_1.collect_fee(@camaro) + @facility_1.collect_fee(@bolt) + expect(@facility_1.collected_fees).to eq(325) + end + + end end diff --git a/spec/vehicle_spec.rb b/spec/vehicle_spec.rb index fcf50b2fa..4bf2c257a 100644 --- a/spec/vehicle_spec.rb +++ b/spec/vehicle_spec.rb @@ -37,12 +37,20 @@ describe 'registration details'do it 'can detect registration date'do @cruz.register + @camaro.register + @bolt.register expect(@cruz.registration_date).to eq(Date.today) + expect(@camaro.registration_date).to eq(Date.today) + expect(@bolt.registration_date).to eq(Date.today) end it 'can check vehicle plate type'do @cruz.register + @camaro.register + @bolt.register expect(@cruz.plate_type).to eq(:regular) + expect(@camaro.plate_type).to eq(:antique) + expect(@bolt.plate_type).to eq(:ev) end From 620b5cf6930d87f8e7a05906498f1181264b58bf Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Sat, 14 Dec 2024 15:22:36 -0600 Subject: [PATCH 04/14] Finished Vehicle Registration feature for facility class --- spec/facility_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/facility_spec.rb b/spec/facility_spec.rb index d9d384567..8d4b33e6e 100644 --- a/spec/facility_spec.rb +++ b/spec/facility_spec.rb @@ -37,6 +37,7 @@ @facility_1.add_service('Renew Drivers License') @facility_1.add_service('Vehicle Registration') expect(@facility_1.services).to eq(['New Drivers License', 'Renew Drivers License', 'Vehicle Registration']) + expect(@facility_2.services).to eq([]) end end @@ -48,6 +49,7 @@ it 'has a list of registered vehicles' do expect(@facility_1.registered_vehicles).to eq ([]) + expect(@facility_2.registered_vehicles).to eq ([]) end it 'keeps track of collected fees' do @@ -59,7 +61,9 @@ @facility_1.register_vehicle(@cruz) @facility_1.register_vehicle(@camero) @facility_1.register_vehicle(@bolt) + @facility_2.register_vehicle(@bolt) expect(@facility_1.registered_vehicles).to eq([@cruz, @camero, @bolt]) + expect(@facility_2.registered_vehicles).to eq([]) end it 'checks that fees are collected when a vehicle is registered' do @@ -67,6 +71,7 @@ @facility_1.collect_fee(@camaro) @facility_1.collect_fee(@bolt) expect(@facility_1.collected_fees).to eq(325) + expect(@facility_2.collected_fees).to eq(0) end From ac10039864438f222a2af5d33b2261c3033186ed Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Sun, 15 Dec 2024 12:09:42 -0600 Subject: [PATCH 05/14] Written test rspec tests all passing --- lib/facility.rb | 10 ++++++++ lib/registrant.rb | 10 ++++++-- spec/facility_spec.rb | 54 +++++++++++++++++++++++++++++++++-------- spec/registrant_spec.rb | 10 ++++++-- 4 files changed, 70 insertions(+), 14 deletions(-) diff --git a/lib/facility.rb b/lib/facility.rb index 5816cfc6a..dfcbbcfa6 100644 --- a/lib/facility.rb +++ b/lib/facility.rb @@ -37,6 +37,16 @@ def collect_fee(vehicle) else @collected_fees += 100 end + + end + + def administer_written_test(registrant) + if @services.include?('Written Test') && registrant.permit? == true && registrant.age >= 16 + registrant.change_license_data(:written) + true + else + return false + end end end diff --git a/lib/registrant.rb b/lib/registrant.rb index e1e51fc9d..3588bff37 100644 --- a/lib/registrant.rb +++ b/lib/registrant.rb @@ -6,11 +6,13 @@ class Registrant :permit, :license_data - def initialize(name, age, license_data, permit = false) + def initialize(name, age, permit = false) @name = name @age = age - @license_data = license_data @permit = permit + @license_data ={:written =>false, + :license =>false, + :renewed =>false} end def permit? @@ -20,4 +22,8 @@ def permit? def earn_permit @permit = true end + + def change_license_data(key) + @license_data[key] = true + end end \ No newline at end of file diff --git a/spec/facility_spec.rb b/spec/facility_spec.rb index 8d4b33e6e..3dcb1a469 100644 --- a/spec/facility_spec.rb +++ b/spec/facility_spec.rb @@ -10,6 +10,10 @@ @cruz = Vehicle.new({vin: '123456789abcdefgh', year: 2012, make: 'Chevrolet', model: 'Cruz', engine: :ice} ) @bolt = Vehicle.new({vin: '987654321abcdefgh', year: 2019, make: 'Chevrolet', model: 'Bolt', engine: :ev} ) @camaro = Vehicle.new({vin: '1a2b3c4d5e6f', year: 1969, make: 'Chevrolet', model: 'Camaro', engine: :ice} ) + + @registrant_1 = Registrant.new("Bruce", 18, true) + @registrant_2 = Registrant.new("Penny", 16) + @registrant_3 = Registrant.new('Tucker', 15 ) end describe '#initialize' do @@ -36,6 +40,7 @@ @facility_1.add_service('New Drivers License') @facility_1.add_service('Renew Drivers License') @facility_1.add_service('Vehicle Registration') + expect(@facility_1.services).to eq(['New Drivers License', 'Renew Drivers License', 'Vehicle Registration']) expect(@facility_2.services).to eq([]) end @@ -43,6 +48,16 @@ describe '#add registration details' do + it 'can register vehicles' do + @facility_1.add_service('Vehicle Registration') + @facility_1.register_vehicle(@cruz) + @facility_1.register_vehicle(@camero) + @facility_1.register_vehicle(@bolt) + @facility_2.register_vehicle(@bolt) + expect(@facility_1.registered_vehicles).to eq([@cruz, @camero, @bolt]) + expect(@facility_2.registered_vehicles).to eq([]) + end + it 'has a registration date for each car' do expect(@cruz.registration_date).to eq(nil) end @@ -56,16 +71,6 @@ expect(@facility_1.collected_fees).to eq(0) end - it 'can register vehicles' do - @facility_1.add_service('Vehicle Registration') - @facility_1.register_vehicle(@cruz) - @facility_1.register_vehicle(@camero) - @facility_1.register_vehicle(@bolt) - @facility_2.register_vehicle(@bolt) - expect(@facility_1.registered_vehicles).to eq([@cruz, @camero, @bolt]) - expect(@facility_2.registered_vehicles).to eq([]) - end - it 'checks that fees are collected when a vehicle is registered' do @facility_1.collect_fee(@cruz) @facility_1.collect_fee(@camaro) @@ -73,7 +78,36 @@ expect(@facility_1.collected_fees).to eq(325) expect(@facility_2.collected_fees).to eq(0) end + end + describe '#testing details'do + it 'can administer a written test'do + @facility_1.add_service('Written Test') + # @facility_1.administer_written_test(@registrant_1) + expect(@facility_1.administer_written_test(@registrant_1)).to eq(true) + expect(@registrant_1.license_data).to eq({:written =>true, :license =>false, :renewed =>false}) + end + it 'checks that facility has written test service' do + expect(@facility_1.administer_written_test(@registrant_1)).to eq(false) + end + + it 'checks for registrants permit status' do + @facility_1.add_service('Written Test') + expect(@facility_1.administer_written_test(@registrant_2)).to eq(false) + + @registrant_2.earn_permit + expect(@facility_1.administer_written_test(@registrant_2)).to eq(true) + expect(@registrant_2.license_data).to eq({:written =>true, :license =>false, :renewed =>false}) + end + + it 'checks that registrant is at least 16' do + @facility_1.add_service('Written Test') + @registrant_3.earn_permit + + expect(@facility_1.administer_written_test(@registrant_3)).to eq(false) + expect(@registrant_3.license_data).to eq({:written =>false, :license =>false, :renewed =>false}) + end end + end diff --git a/spec/registrant_spec.rb b/spec/registrant_spec.rb index 233b108dd..6b7805b8a 100644 --- a/spec/registrant_spec.rb +++ b/spec/registrant_spec.rb @@ -2,14 +2,16 @@ RSpec.describe Registrant do before(:each) do - @registrant_1 = Registrant.new("Bruce", 18, {:written =>false, :license => false, :renewed => false}, true) - @registrant_2 = Registrant.new("Penny", 15, {:written =>false, :license => false, :renewed => false}) + @registrant_1 = Registrant.new("Bruce", 18, true) + @registrant_2 = Registrant.new("Penny", 15) + @registrant_3 = Registrant.new('Tucker', 15 ) end describe 'initialize'do it 'can initialize' do expect(@registrant_1). to be_an_instance_of(Registrant) expect(@registrant_2). to be_an_instance_of(Registrant) + expect(@registrant_3). to be_an_instance_of(Registrant) end end @@ -17,21 +19,25 @@ it 'can store names'do expect(@registrant_1.name). to eq("Bruce") expect(@registrant_2.name). to eq("Penny") + expect(@registrant_3.name). to eq("Tucker") end it 'can store ages' do expect(@registrant_1.age).to eq(18) expect(@registrant_2.age).to eq(15) + expect(@registrant_3.age).to eq(15) end it 'can tell if they have a permit'do expect(@registrant_1.permit?). to eq(true) expect(@registrant_2.permit?). to eq(false) + expect(@registrant_3.permit?). to eq(false) end it 'can pull license data'do expect(@registrant_1.license_data).to eq({:written =>false, :license => false, :renewed => false}) expect(@registrant_2.license_data).to eq({:written =>false, :license => false, :renewed => false}) + expect(@registrant_3.license_data).to eq({:written =>false, :license => false, :renewed => false}) end it 'can let registrants earn permit'do From 0e11ed1357bb3cc92b2f12d36e5085cc13fd1d57 Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Sun, 15 Dec 2024 13:08:41 -0600 Subject: [PATCH 06/14] Driver's license tests all passing --- lib/facility.rb | 15 +++++++++++++++ spec/facility_spec.rb | 31 ++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/lib/facility.rb b/lib/facility.rb index dfcbbcfa6..a129ad09f 100644 --- a/lib/facility.rb +++ b/lib/facility.rb @@ -41,12 +41,27 @@ def collect_fee(vehicle) end def administer_written_test(registrant) + if @services.include?('Written Test') && registrant.permit? == true && registrant.age >= 16 registrant.change_license_data(:written) true else return false end + + end + + def administer_road_test(registrant) + + if @services.include?('Road Test') && registrant.age >= 16 && registrant.license_data[:written] == true + registrant.change_license_data(:license) + true + else + return false + end + end + + end diff --git a/spec/facility_spec.rb b/spec/facility_spec.rb index 3dcb1a469..88289690e 100644 --- a/spec/facility_spec.rb +++ b/spec/facility_spec.rb @@ -40,8 +40,10 @@ @facility_1.add_service('New Drivers License') @facility_1.add_service('Renew Drivers License') @facility_1.add_service('Vehicle Registration') + @facility_1.add_service('Road Test') + @facility_1.add_service('Written Test') - expect(@facility_1.services).to eq(['New Drivers License', 'Renew Drivers License', 'Vehicle Registration']) + expect(@facility_1.services).to eq(['New Drivers License', 'Renew Drivers License', 'Vehicle Registration', 'Road Test', 'Written Test']) expect(@facility_2.services).to eq([]) end end @@ -81,6 +83,10 @@ end describe '#testing details'do + it 'checks that facility has written test service' do + expect(@facility_1.administer_written_test(@registrant_1)).to eq(false) + end + it 'can administer a written test'do @facility_1.add_service('Written Test') # @facility_1.administer_written_test(@registrant_1) @@ -88,10 +94,6 @@ expect(@registrant_1.license_data).to eq({:written =>true, :license =>false, :renewed =>false}) end - it 'checks that facility has written test service' do - expect(@facility_1.administer_written_test(@registrant_1)).to eq(false) - end - it 'checks for registrants permit status' do @facility_1.add_service('Written Test') expect(@facility_1.administer_written_test(@registrant_2)).to eq(false) @@ -108,6 +110,25 @@ expect(@facility_1.administer_written_test(@registrant_3)).to eq(false) expect(@registrant_3.license_data).to eq({:written =>false, :license =>false, :renewed =>false}) end + + it 'checks facility has road test service' do + # @facility_1.administer_road_test(@registrant_1) + expect(@facility_1.administer_road_test(@registrant_1)).to eq(false) + end + + it 'can administer road test' do + @facility_1.add_service('Written Test') + @facility_1.add_service('Road Test') + @facility_1.administer_written_test(@registrant_1) + @facility_1.administer_road_test(@registrant_1) + @registrant_2.earn_permit + @facility_1.administer_written_test(@registrant_2) + @facility_1.administer_road_test(@registrant_2) + expect(@facility_1.administer_road_test(@registrant_1)).to eq(true) + expect(@facility_1.administer_road_test(@registrant_2)).to eq(true) + expect(@registrant_1.license_data).to eq({:written =>true,:license =>true,:renewed =>false}) + expect(@registrant_2.license_data).to eq({:written =>true,:license =>true,:renewed =>false}) + end end end From 5f38139db9f526932eb2f97e378eb9652458aaa2 Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Sun, 15 Dec 2024 13:30:09 -0600 Subject: [PATCH 07/14] Written, road, and renew license tests all passing --- lib/facility.rb | 9 +++++++++ spec/facility_spec.rb | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/lib/facility.rb b/lib/facility.rb index a129ad09f..27576ecba 100644 --- a/lib/facility.rb +++ b/lib/facility.rb @@ -62,6 +62,15 @@ def administer_road_test(registrant) end + def renew_drviers_license(registrant) + if @services.include?('Renew License') && registrant.license_data[:written] == true && registrant.license_data[:license] == true + registrant.change_license_data(:renewed) + true + else + return false + end + end + end diff --git a/spec/facility_spec.rb b/spec/facility_spec.rb index 88289690e..2470e0ede 100644 --- a/spec/facility_spec.rb +++ b/spec/facility_spec.rb @@ -131,4 +131,28 @@ end end + describe 'renew license'do + it 'checks facility for renew license service' do + expect(@facility_1.renew_drviers_license(@registrant_1)).to eq(false) + end + + it 'can renew license' do + @facility_1.add_service('Written Test') + @facility_1.add_service('Road Test') + @facility_1.add_service('Renew License') + @facility_1.administer_written_test(@registrant_1) + @facility_1.administer_road_test(@registrant_1) + @facility_1.renew_drviers_license(@registrant_1) + @registrant_2.earn_permit + @facility_1.administer_written_test(@registrant_2) + @facility_1.administer_road_test(@registrant_2) + @facility_1.renew_drviers_license(@registrant_3) + expect(@facility_1.renew_drviers_license(@registrant_1)).to eq(true) + expect(@facility_1.renew_drviers_license(@registrant_3)).to eq(false) + expect(@facility_1.renew_drviers_license(@registrant_2)).to eq(true) + expect(@registrant_1.license_data).to eq({:written =>true,:license =>true,:renewed =>true}) + expect(@registrant_2.license_data).to eq({:written =>true,:license =>true,:renewed =>true}) + expect(@registrant_3.license_data).to eq({:written =>false,:license =>false,:renewed =>false}) + end + end end From e161d8818e180186a89a6611092ef2df8e804bda Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Sun, 15 Dec 2024 15:48:56 -0600 Subject: [PATCH 08/14] Rspec tests for vehicle factory passing --- lib/vehicle_factory.rb | 21 +++++++++++++++++++++ spec/vehicle_factory_spec.rb | 31 +++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 lib/vehicle_factory.rb create mode 100644 spec/vehicle_factory_spec.rb diff --git a/lib/vehicle_factory.rb b/lib/vehicle_factory.rb new file mode 100644 index 000000000..7d531200f --- /dev/null +++ b/lib/vehicle_factory.rb @@ -0,0 +1,21 @@ +class VehicleFactory + attr_reader :created_vehicles + def initialize + # @created_vehicles = [] + end + + def create_vehicles(vehicle_data) + @created_vehicles = [] + vehicle_data.each do |vehicle| + new_vehicle = Vehicle.new ({ + :vin => vehicle[:vin_1_10], + :year => vehicle[:model_year], + :make => vehicle[:make], + :model => vehicle[:model], + :engine => :ev + }) + @created_vehicles << new_vehicle + end + end + +end \ No newline at end of file diff --git a/spec/vehicle_factory_spec.rb b/spec/vehicle_factory_spec.rb new file mode 100644 index 000000000..8f8ac87b9 --- /dev/null +++ b/spec/vehicle_factory_spec.rb @@ -0,0 +1,31 @@ +require './lib/vehicle' +require './lib/vehicle_factory' +require './lib/dmv_data_service' +require 'pry' +RSpec.describe VehicleFactory do + + before(:each) do + @factory = VehicleFactory.new + #vehicle = Vehicle.new({vin:'WBY8P8C51K', year: 2019, make: 'BMW', model: 'i3', engine: :ev} ) + end + + describe '#initialize' do + it 'checks Vehicle Factory class exists' do + expect(@factory).to be_a(VehicleFactory) + end + end + + describe 'creates vehicles' do + it 'can create vehicles' do + wa_ev_registrations = DmvDataService.new.wa_ev_registrations + created_vehicles = @factory.create_vehicles(wa_ev_registrations) + + expect(@factory.created_vehicles[0].vin).to eq('WBY8P8C51K') + expect(@factory.created_vehicles[0].year).to eq('2019') + expect(@factory.created_vehicles[0].make).to eq('BMW') + expect(@factory.created_vehicles[0].model).to eq('i3') + expect(@factory.created_vehicles[0].engine).to eq(:ev) + end + end + +end \ No newline at end of file From ba3958915a8bc30fc1b7bcb9c74e18f39ceb545b Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Mon, 16 Dec 2024 16:29:42 -0600 Subject: [PATCH 09/14] All tests for co_dmv_locations passing --- lib/dmv_facilities.rb | 19 +++++++++++++++++++ lib/vehicle_factory.rb | 3 ++- spec/dmv_facilities_spec.rb | 26 ++++++++++++++++++++++++++ spec/spec_helper.rb | 2 ++ spec/vehicle_factory_spec.rb | 1 - 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 lib/dmv_facilities.rb create mode 100644 spec/dmv_facilities_spec.rb diff --git a/lib/dmv_facilities.rb b/lib/dmv_facilities.rb new file mode 100644 index 000000000..aa3775cd2 --- /dev/null +++ b/lib/dmv_facilities.rb @@ -0,0 +1,19 @@ +class DMVFacilities + attr_reader :created_facilities + def initialize + @created_facilities = [] + end + + def create_facilities(facility_data) + @created_facilities = [] + facility_data.each do |facility| + new_facility = Facility.new({ + :name => facility[:dmv_office], + :address => facility[:address_li], + :phone => facility[:phone] + }) + @created_facilities << new_facility + #binding.pry + end + end +end \ No newline at end of file diff --git a/lib/vehicle_factory.rb b/lib/vehicle_factory.rb index 7d531200f..f6aea3c9a 100644 --- a/lib/vehicle_factory.rb +++ b/lib/vehicle_factory.rb @@ -1,7 +1,7 @@ class VehicleFactory attr_reader :created_vehicles def initialize - # @created_vehicles = [] + @created_vehicles = [] end def create_vehicles(vehicle_data) @@ -15,6 +15,7 @@ def create_vehicles(vehicle_data) :engine => :ev }) @created_vehicles << new_vehicle + binding.pry end end diff --git a/spec/dmv_facilities_spec.rb b/spec/dmv_facilities_spec.rb new file mode 100644 index 000000000..870e0704a --- /dev/null +++ b/spec/dmv_facilities_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +RSpec.describe DMVFacilities do + + before(:each) do + @facility = DMVFacilities.new + end + + describe '#initialize' do + it 'checks DMVFacilities class exists' do + expect(@facility).to be_a(DMVFacilities) + end + end + + describe 'creates facilities' do + it 'can create facilities' do + co_dmv_office_locations = DmvDataService.new.co_dmv_office_locations + created_facilities = @facility.create_facilities(co_dmv_office_locations) + # binding.pry + expect(@facility.created_facilities[0].name).to eq('DMV Tremont Branch') + expect(@facility.created_facilities[0].address).to eq('2855 Tremont Place') + expect(@facility.created_facilities[0].phone).to eq('(720) 865-4600') + end + end + +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 58d13198f..6ab5a0636 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,3 +4,5 @@ require './lib/vehicle' require './lib/dmv_data_service' require './lib/registrant' +require './lib/dmv_facilities' +require './lib/vehicle_factory' diff --git a/spec/vehicle_factory_spec.rb b/spec/vehicle_factory_spec.rb index 8f8ac87b9..019ec44ac 100644 --- a/spec/vehicle_factory_spec.rb +++ b/spec/vehicle_factory_spec.rb @@ -6,7 +6,6 @@ before(:each) do @factory = VehicleFactory.new - #vehicle = Vehicle.new({vin:'WBY8P8C51K', year: 2019, make: 'BMW', model: 'i3', engine: :ev} ) end describe '#initialize' do From b56d3fb4f498181ba470744790dc2ea230e6e96b Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Mon, 16 Dec 2024 18:57:17 -0600 Subject: [PATCH 10/14] All rspec tests passing through iteration 3 with all state datasets --- lib/dmv_facilities.rb | 16 ++++++++-------- lib/vehicle_factory.rb | 1 - spec/dmv_facilities_spec.rb | 33 ++++++++++++++++++++++++++------- spec/vehicle_factory_spec.rb | 2 +- 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/lib/dmv_facilities.rb b/lib/dmv_facilities.rb index aa3775cd2..4ac63629b 100644 --- a/lib/dmv_facilities.rb +++ b/lib/dmv_facilities.rb @@ -1,19 +1,19 @@ class DMVFacilities - attr_reader :created_facilities + attr_reader :facilities + def initialize - @created_facilities = [] + @facilities = [] end def create_facilities(facility_data) - @created_facilities = [] + @facilities = [] facility_data.each do |facility| new_facility = Facility.new({ - :name => facility[:dmv_office], - :address => facility[:address_li], - :phone => facility[:phone] + :name => "#{facility[:dmv_office]}#{facility[:office_name]}#{facility[:name]}", + :address => "#{facility[:address_li]}#{facility[:street_address_line_1]}#{facility[:address1]} #{facility[:city]} #{facility[:state]} #{facility[:zip_code]}#{facility[:zipcode]}", + :phone => "#{facility[:phone]}#{facility[:public_phone_number]}" }) - @created_facilities << new_facility - #binding.pry + @facilities << new_facility end end end \ No newline at end of file diff --git a/lib/vehicle_factory.rb b/lib/vehicle_factory.rb index f6aea3c9a..9bd11cd3b 100644 --- a/lib/vehicle_factory.rb +++ b/lib/vehicle_factory.rb @@ -15,7 +15,6 @@ def create_vehicles(vehicle_data) :engine => :ev }) @created_vehicles << new_vehicle - binding.pry end end diff --git a/spec/dmv_facilities_spec.rb b/spec/dmv_facilities_spec.rb index 870e0704a..7835f9a60 100644 --- a/spec/dmv_facilities_spec.rb +++ b/spec/dmv_facilities_spec.rb @@ -12,14 +12,33 @@ end end - describe 'creates facilities' do - it 'can create facilities' do + describe 'creates colorado facilities' do + it 'can create colorado facilities' do co_dmv_office_locations = DmvDataService.new.co_dmv_office_locations - created_facilities = @facility.create_facilities(co_dmv_office_locations) - # binding.pry - expect(@facility.created_facilities[0].name).to eq('DMV Tremont Branch') - expect(@facility.created_facilities[0].address).to eq('2855 Tremont Place') - expect(@facility.created_facilities[0].phone).to eq('(720) 865-4600') + @facility.create_facilities(co_dmv_office_locations) + expect(@facility.facilities[0].name).to eq('DMV Tremont Branch') + expect(@facility.facilities[0].address).to eq('2855 Tremont Place Denver CO ') + expect(@facility.facilities[0].phone).to eq('(720) 865-4600') + end + end + + describe 'creates new york facilities' do + it 'can create new york facilities' do + ny_dmv_office_locations = DmvDataService.new.ny_dmv_office_locations + @facility.create_facilities(ny_dmv_office_locations) + expect(@facility.facilities[1].name).to eq('HUDSON') + expect(@facility.facilities[1].address).to eq("560 WARREN STREET HUDSON NY 12534") + expect(@facility.facilities[1].phone).to eq('5188283350') + end + end + + describe 'creates missouri facilities' do + it 'can create missouri facilities' do + mo_dmv_office_locations = DmvDataService.new.mo_dmv_office_locations + @facility.create_facilities(mo_dmv_office_locations) + expect(@facility.facilities[0].name).to eq('Harrisonville') + expect(@facility.facilities[0].address).to eq("2009 Plaza Dr. Harrisonville MO 64701") + expect(@facility.facilities[0].phone).to eq('(816) 884-4133') end end diff --git a/spec/vehicle_factory_spec.rb b/spec/vehicle_factory_spec.rb index 019ec44ac..183691e8c 100644 --- a/spec/vehicle_factory_spec.rb +++ b/spec/vehicle_factory_spec.rb @@ -17,7 +17,7 @@ describe 'creates vehicles' do it 'can create vehicles' do wa_ev_registrations = DmvDataService.new.wa_ev_registrations - created_vehicles = @factory.create_vehicles(wa_ev_registrations) + @factory.create_vehicles(wa_ev_registrations) expect(@factory.created_vehicles[0].vin).to eq('WBY8P8C51K') expect(@factory.created_vehicles[0].year).to eq('2019') From 87a1e1bd8ae84c3ef4b83f14412830251f4b2a58 Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Mon, 16 Dec 2024 19:01:30 -0600 Subject: [PATCH 11/14] Iteration 3 complete --- spec/dmv_data_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/dmv_data_service_spec.rb b/spec/dmv_data_service_spec.rb index 7baf709a0..986136f6d 100644 --- a/spec/dmv_data_service_spec.rb +++ b/spec/dmv_data_service_spec.rb @@ -42,4 +42,4 @@ expect(@dds.mo_dmv_office_locations.size).to be_an(Integer) end end -end +end From dfd5f507328137353d4fe56cb0dda39b33e03677 Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Mon, 16 Dec 2024 19:03:41 -0600 Subject: [PATCH 12/14] All tests passing for Iteration 3 --- spec/dmv_facilities_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/dmv_facilities_spec.rb b/spec/dmv_facilities_spec.rb index 7835f9a60..209df66e5 100644 --- a/spec/dmv_facilities_spec.rb +++ b/spec/dmv_facilities_spec.rb @@ -31,7 +31,7 @@ expect(@facility.facilities[1].phone).to eq('5188283350') end end - + describe 'creates missouri facilities' do it 'can create missouri facilities' do mo_dmv_office_locations = DmvDataService.new.mo_dmv_office_locations From 7d1a2e81585e73103feebb249ed1bcd8584a62ca Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Tue, 17 Dec 2024 12:00:13 -0600 Subject: [PATCH 13/14] Refactoring code lines and organization --- lib/facility.rb | 3 --- lib/vehicle_factory.rb | 1 + spec/facility_spec.rb | 3 --- spec/vehicle_factory_spec.rb | 6 ++---- spec/vehicle_spec.rb | 8 +++----- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/lib/facility.rb b/lib/facility.rb index 27576ecba..e2e5a33d8 100644 --- a/lib/facility.rb +++ b/lib/facility.rb @@ -1,4 +1,3 @@ -require 'pry' class Facility attr_reader :name, :address, @@ -71,6 +70,4 @@ def renew_drviers_license(registrant) end end - - end diff --git a/lib/vehicle_factory.rb b/lib/vehicle_factory.rb index 9bd11cd3b..1b1fb6904 100644 --- a/lib/vehicle_factory.rb +++ b/lib/vehicle_factory.rb @@ -1,5 +1,6 @@ class VehicleFactory attr_reader :created_vehicles + def initialize @created_vehicles = [] end diff --git a/spec/facility_spec.rb b/spec/facility_spec.rb index 2470e0ede..34f6c2295 100644 --- a/spec/facility_spec.rb +++ b/spec/facility_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require 'pry' RSpec.describe Facility do before(:each) do @@ -89,7 +88,6 @@ it 'can administer a written test'do @facility_1.add_service('Written Test') - # @facility_1.administer_written_test(@registrant_1) expect(@facility_1.administer_written_test(@registrant_1)).to eq(true) expect(@registrant_1.license_data).to eq({:written =>true, :license =>false, :renewed =>false}) end @@ -112,7 +110,6 @@ end it 'checks facility has road test service' do - # @facility_1.administer_road_test(@registrant_1) expect(@facility_1.administer_road_test(@registrant_1)).to eq(false) end diff --git a/spec/vehicle_factory_spec.rb b/spec/vehicle_factory_spec.rb index 183691e8c..1bbb7e93a 100644 --- a/spec/vehicle_factory_spec.rb +++ b/spec/vehicle_factory_spec.rb @@ -1,7 +1,5 @@ -require './lib/vehicle' -require './lib/vehicle_factory' -require './lib/dmv_data_service' -require 'pry' +require 'spec_helper' + RSpec.describe VehicleFactory do before(:each) do diff --git a/spec/vehicle_spec.rb b/spec/vehicle_spec.rb index 4bf2c257a..aa66cd6a7 100644 --- a/spec/vehicle_spec.rb +++ b/spec/vehicle_spec.rb @@ -6,6 +6,7 @@ @bolt = Vehicle.new({vin: '987654321abcdefgh', year: 2019, make: 'Chevrolet', model: 'Bolt', engine: :ev} ) @camaro = Vehicle.new({vin: '1a2b3c4d5e6f', year: 1969, make: 'Chevrolet', model: 'Camaro', engine: :ice} ) end + describe '#initialize' do it 'can initialize' do expect(@cruz).to be_an_instance_of(Vehicle) @@ -14,7 +15,6 @@ expect(@cruz.make).to eq('Chevrolet') expect(@cruz.model).to eq('Cruz') expect(@cruz.engine).to eq(:ice) - # expect(@cruz.registration_date).to eq(nil) end end @@ -34,7 +34,7 @@ end end - describe 'registration details'do + describe '#registration details'do it 'can detect registration date'do @cruz.register @camaro.register @@ -44,7 +44,7 @@ expect(@bolt.registration_date).to eq(Date.today) end - it 'can check vehicle plate type'do + it '#can check vehicle plate type'do @cruz.register @camaro.register @bolt.register @@ -52,7 +52,5 @@ expect(@camaro.plate_type).to eq(:antique) expect(@bolt.plate_type).to eq(:ev) end - - end end From 059e1d12cda5aedfa2efbc9986cf215741344c6c Mon Sep 17 00:00:00 2001 From: Beverly Green Date: Tue, 17 Dec 2024 12:26:53 -0600 Subject: [PATCH 14/14] final refactoring finished --- lib/dmv.rb | 1 + lib/vehicle.rb | 3 +-- spec/dmv_facilities_spec.rb | 6 +++--- spec/facility_spec.rb | 2 +- spec/registrant_spec.rb | 4 ++-- spec/vehicle_factory_spec.rb | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/dmv.rb b/lib/dmv.rb index 3b3c2f2e8..c54dc8312 100644 --- a/lib/dmv.rb +++ b/lib/dmv.rb @@ -14,4 +14,5 @@ def facilities_offering_service(service) facility.services.include?(service) end end + end diff --git a/lib/vehicle.rb b/lib/vehicle.rb index 6f1083f3d..da76ce874 100644 --- a/lib/vehicle.rb +++ b/lib/vehicle.rb @@ -39,6 +39,5 @@ def register end end - - + end diff --git a/spec/dmv_facilities_spec.rb b/spec/dmv_facilities_spec.rb index 209df66e5..243d66be6 100644 --- a/spec/dmv_facilities_spec.rb +++ b/spec/dmv_facilities_spec.rb @@ -12,7 +12,7 @@ end end - describe 'creates colorado facilities' do + describe '#creates colorado facilities' do it 'can create colorado facilities' do co_dmv_office_locations = DmvDataService.new.co_dmv_office_locations @facility.create_facilities(co_dmv_office_locations) @@ -22,7 +22,7 @@ end end - describe 'creates new york facilities' do + describe '#creates new york facilities' do it 'can create new york facilities' do ny_dmv_office_locations = DmvDataService.new.ny_dmv_office_locations @facility.create_facilities(ny_dmv_office_locations) @@ -32,7 +32,7 @@ end end - describe 'creates missouri facilities' do + describe '#creates missouri facilities' do it 'can create missouri facilities' do mo_dmv_office_locations = DmvDataService.new.mo_dmv_office_locations @facility.create_facilities(mo_dmv_office_locations) diff --git a/spec/facility_spec.rb b/spec/facility_spec.rb index 34f6c2295..9cb44c7e2 100644 --- a/spec/facility_spec.rb +++ b/spec/facility_spec.rb @@ -128,7 +128,7 @@ end end - describe 'renew license'do + describe '#renew license'do it 'checks facility for renew license service' do expect(@facility_1.renew_drviers_license(@registrant_1)).to eq(false) end diff --git a/spec/registrant_spec.rb b/spec/registrant_spec.rb index 6b7805b8a..cbbe5571e 100644 --- a/spec/registrant_spec.rb +++ b/spec/registrant_spec.rb @@ -7,7 +7,7 @@ @registrant_3 = Registrant.new('Tucker', 15 ) end - describe 'initialize'do + describe '#initialize'do it 'can initialize' do expect(@registrant_1). to be_an_instance_of(Registrant) expect(@registrant_2). to be_an_instance_of(Registrant) @@ -15,7 +15,7 @@ end end - describe 'registrant data' do + describe '#registrant data' do it 'can store names'do expect(@registrant_1.name). to eq("Bruce") expect(@registrant_2.name). to eq("Penny") diff --git a/spec/vehicle_factory_spec.rb b/spec/vehicle_factory_spec.rb index 1bbb7e93a..c7e6d8486 100644 --- a/spec/vehicle_factory_spec.rb +++ b/spec/vehicle_factory_spec.rb @@ -12,7 +12,7 @@ end end - describe 'creates vehicles' do + describe '#creates vehicles' do it 'can create vehicles' do wa_ev_registrations = DmvDataService.new.wa_ev_registrations @factory.create_vehicles(wa_ev_registrations)