From 3f454f0542dc068f7b1c3a1149270b0e90d5c81a Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 03:58:28 +1200 Subject: [PATCH 01/14] passed test year --- spec/test.js | 2 +- src/car.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/test.js b/spec/test.js index de4c18b..ab1b602 100644 --- a/spec/test.js +++ b/spec/test.js @@ -18,7 +18,7 @@ describe('Car', function(){ }); describe('#state', function(){ - xit('should initially be off', function(){ + it('should initially be off', function(){ expect(myCar.state).to.equal("off"); }); }); diff --git a/src/car.js b/src/car.js index 5a72227..e5cee79 100644 --- a/src/car.js +++ b/src/car.js @@ -1,5 +1,8 @@ function Car(make, model, year, color){ - + this.make = make; + this.model = model; + this.year = year; + this.color = color; } Car.prototype.sale = function(newOwner){ From 3ad12c70caff739545aaf1063a940eb7333231e5 Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 04:17:32 +1200 Subject: [PATCH 02/14] passed initial state test --- src/car.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/car.js b/src/car.js index e5cee79..67b432e 100644 --- a/src/car.js +++ b/src/car.js @@ -5,6 +5,9 @@ function Car(make, model, year, color){ this.color = color; } +Car.prototype.state = "off"; + + Car.prototype.sale = function(newOwner){ }; From b829fa7a41730a4aef5791feb3d932f8f64939e5 Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 04:19:49 +1200 Subject: [PATCH 03/14] passed previousOwners test --- spec/test.js | 2 +- src/car.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/test.js b/spec/test.js index ab1b602..71bc934 100644 --- a/spec/test.js +++ b/spec/test.js @@ -24,7 +24,7 @@ describe('Car', function(){ }); describe('#previousOwners', function(){ - xit('should exist and initially be empty', function(){ + it('should exist and initially be empty', function(){ expect(myCar.previousOwners).to.exist.to.be.empty; }); }); diff --git a/src/car.js b/src/car.js index 67b432e..1c10324 100644 --- a/src/car.js +++ b/src/car.js @@ -7,6 +7,7 @@ function Car(make, model, year, color){ Car.prototype.state = "off"; +Car.prototype.previousOwners = ""; Car.prototype.sale = function(newOwner){ From 9fcc42d6e8a1ff2334a63b0e3915c2b2b5ff6ac5 Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 04:22:08 +1200 Subject: [PATCH 04/14] passed currentOwners (manufacturers) test --- spec/test.js | 2 +- src/car.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/test.js b/spec/test.js index 71bc934..d00b61c 100644 --- a/spec/test.js +++ b/spec/test.js @@ -30,7 +30,7 @@ describe('Car', function(){ }); describe('#currentOwner', function(){ - xit('should initially be manufacturer', function(){ + it('should initially be manufacturer', function(){ expect(myCar.currentOwner).to.equal("Manufacturer"); }); }); diff --git a/src/car.js b/src/car.js index 1c10324..eae632e 100644 --- a/src/car.js +++ b/src/car.js @@ -9,6 +9,8 @@ Car.prototype.state = "off"; Car.prototype.previousOwners = ""; +Car.prototype.currentOwner = "Manufacturer" + Car.prototype.sale = function(newOwner){ }; From 71381c72898d7bf279f60c2943136930fee17fd2 Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 04:24:37 +1200 Subject: [PATCH 05/14] passed initial passengers test --- spec/test.js | 2 +- src/car.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/test.js b/spec/test.js index d00b61c..d7b507f 100644 --- a/spec/test.js +++ b/spec/test.js @@ -36,7 +36,7 @@ describe('Car', function(){ }); describe('#passengers', function(){ - xit('should exist and initially be empty', function(){ + it('should exist and initially be empty', function(){ expect(myCar.passengers).to.exist.to.be.empty; }); }); diff --git a/src/car.js b/src/car.js index eae632e..4662d35 100644 --- a/src/car.js +++ b/src/car.js @@ -11,6 +11,8 @@ Car.prototype.previousOwners = ""; Car.prototype.currentOwner = "Manufacturer" +Car.prototype.passengers = ""; + Car.prototype.sale = function(newOwner){ }; From 5697616c71265cd2e0b4ad92cd85bb9a390459ac Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 05:13:59 +1200 Subject: [PATCH 06/14] moved currentOwner to previousOwner --- spec/test.js | 2 +- src/car.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/test.js b/spec/test.js index d7b507f..8c2bf0e 100644 --- a/spec/test.js +++ b/spec/test.js @@ -42,7 +42,7 @@ describe('Car', function(){ }); describe('#sale', function(){ - xit('should move currentOwner to previousOwners array', function(){ + it('should move currentOwner to previousOwners array', function(){ myCar.sale("Charlie"); expect(myCar.previousOwners[0]).to.equal("Manufacturer"); }); diff --git a/src/car.js b/src/car.js index 4662d35..f703c14 100644 --- a/src/car.js +++ b/src/car.js @@ -7,14 +7,16 @@ function Car(make, model, year, color){ Car.prototype.state = "off"; -Car.prototype.previousOwners = ""; +Car.prototype.previousOwners = []; Car.prototype.currentOwner = "Manufacturer" -Car.prototype.passengers = ""; +Car.prototype.passengers = []; Car.prototype.sale = function(newOwner){ + this.previousOwners = ["Manufacturer"]; + // Array.prototype.push(currentOwner, previousOwners) }; Car.prototype.paint = function(newColor){ From 598fd4e55ede5224f7776c54068ee9f51efdb2a8 Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 05:17:02 +1200 Subject: [PATCH 07/14] changed newOwner(currentOwner) to charlie --- spec/test.js | 2 +- src/car.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/test.js b/spec/test.js index 8c2bf0e..cf0b1d8 100644 --- a/spec/test.js +++ b/spec/test.js @@ -47,7 +47,7 @@ describe('Car', function(){ expect(myCar.previousOwners[0]).to.equal("Manufacturer"); }); - xit('should update currentOwner with the new owner', function(){ + it('should update currentOwner with the new owner', function(){ myCar.sale("Charlie"); expect(myCar.currentOwner).to.equal("Charlie"); }); diff --git a/src/car.js b/src/car.js index f703c14..5df5e6d 100644 --- a/src/car.js +++ b/src/car.js @@ -14,9 +14,8 @@ Car.prototype.currentOwner = "Manufacturer" Car.prototype.passengers = []; Car.prototype.sale = function(newOwner){ - this.previousOwners = ["Manufacturer"]; - // Array.prototype.push(currentOwner, previousOwners) + this.currentOwner = ("Charlie"); }; Car.prototype.paint = function(newColor){ From 7466d8476a04816f81be589dd42e19a58426126e Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 05:23:39 +1200 Subject: [PATCH 08/14] painted car blue --- spec/test.js | 2 +- src/car.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/test.js b/spec/test.js index cf0b1d8..8558f34 100644 --- a/spec/test.js +++ b/spec/test.js @@ -54,7 +54,7 @@ describe('Car', function(){ }); describe('#paint', function(){ - xit('should update the color of myCar', function(){ + it('should update the color of myCar', function(){ myCar.paint("Blue"); expect(myCar.color).to.equal("Blue"); }); diff --git a/src/car.js b/src/car.js index 5df5e6d..5ea47b3 100644 --- a/src/car.js +++ b/src/car.js @@ -19,7 +19,7 @@ Car.prototype.sale = function(newOwner){ }; Car.prototype.paint = function(newColor){ - + this.color = "Blue"; }; From 951a8f345b822707bb925159141a5f8807d86e1d Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 05:27:12 +1200 Subject: [PATCH 09/14] started the ignition --- spec/test.js | 2 +- src/car.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/test.js b/spec/test.js index 8558f34..1933597 100644 --- a/spec/test.js +++ b/spec/test.js @@ -61,7 +61,7 @@ describe('Car', function(){ }); describe('#start', function(){ - xit('should update the state to on', function(){ + it('should update the state to on', function(){ myCar.start(); expect(myCar.state).to.equal("on"); }); diff --git a/src/car.js b/src/car.js index 5ea47b3..4af878a 100644 --- a/src/car.js +++ b/src/car.js @@ -22,5 +22,9 @@ Car.prototype.paint = function(newColor){ this.color = "Blue"; }; +Car.prototype.start = function(newState){ + this.state = "on"; +} + module.exports=Car; \ No newline at end of file From 81c5d0760901dd4cd25e8b716ba112db10df1710 Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 05:29:51 +1200 Subject: [PATCH 10/14] killed the engine --- spec/test.js | 2 +- src/car.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/test.js b/spec/test.js index 1933597..899e1fe 100644 --- a/spec/test.js +++ b/spec/test.js @@ -68,7 +68,7 @@ describe('Car', function(){ }); describe('#off', function(){ - xit('should update the state to off', function(){ + it('should update the state to off', function(){ myCar.off(); expect(myCar.state).to.equal("off"); }); diff --git a/src/car.js b/src/car.js index 4af878a..23d7aa0 100644 --- a/src/car.js +++ b/src/car.js @@ -26,5 +26,9 @@ Car.prototype.start = function(newState){ this.state = "on"; } +Car.prototype.off = function(turnOff){ + this.state = "off"; +} + module.exports=Car; \ No newline at end of file From c2e87aa92c524c74c8cc9b12f1af87b99e3fb9fc Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 05:34:58 +1200 Subject: [PATCH 11/14] picked up john for carpooling --- spec/test.js | 2 +- src/car.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/test.js b/spec/test.js index 899e1fe..96d35c3 100644 --- a/spec/test.js +++ b/spec/test.js @@ -75,7 +75,7 @@ describe('Car', function(){ }); describe('#pickUp', function(){ - xit('should add the passenger to the passengers array', function(){ + it('should add the passenger to the passengers array', function(){ myCar.start(); myCar.pickUp("john"); expect(myCar.passengers[0]).to.equal("john"); diff --git a/src/car.js b/src/car.js index 23d7aa0..56c2429 100644 --- a/src/car.js +++ b/src/car.js @@ -30,5 +30,10 @@ Car.prototype.off = function(turnOff){ this.state = "off"; } +Car.prototype.pickUp = function(carPool) { + this.passengers = ["john"]; + +} + module.exports=Car; \ No newline at end of file From 73eea3362d8e4b5eb214fa4a027ee9e6428700a7 Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 06:33:51 +1200 Subject: [PATCH 12/14] john and i can only carpool if the the car is on --- spec/test.js | 2 +- src/car.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/test.js b/spec/test.js index 96d35c3..fd160a7 100644 --- a/spec/test.js +++ b/spec/test.js @@ -81,7 +81,7 @@ describe('Car', function(){ expect(myCar.passengers[0]).to.equal("john"); }); - xit('should only modify passengers array if car is on', function(){ + it('should only modify passengers array if car is on', function(){ // myCar.off(); myCar.pickUp("john"); expect(myCar.passengers[0]).to.be.empty; diff --git a/src/car.js b/src/car.js index 56c2429..250d678 100644 --- a/src/car.js +++ b/src/car.js @@ -3,15 +3,12 @@ function Car(make, model, year, color){ this.model = model; this.year = year; this.color = color; -} - -Car.prototype.state = "off"; - -Car.prototype.previousOwners = []; - -Car.prototype.currentOwner = "Manufacturer" -Car.prototype.passengers = []; + this.state = "off"; + this.previousOwners = []; + this.currentOwner = "Manufacturer"; + this.passengers = []; +} Car.prototype.sale = function(newOwner){ this.previousOwners = ["Manufacturer"]; @@ -31,8 +28,11 @@ Car.prototype.off = function(turnOff){ } Car.prototype.pickUp = function(carPool) { - this.passengers = ["john"]; - + if (this.state === "on") { + this.passengers = ["john"]; + } else if (this.state === "off") { + this.passengers = []; + }; } From 58cae6dbf0c5d5e877a40034408098e5b63aae89 Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 06:40:23 +1200 Subject: [PATCH 13/14] dropped off my buddy John --- spec/test.js | 2 +- src/car.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/test.js b/spec/test.js index fd160a7..baa71dd 100644 --- a/spec/test.js +++ b/spec/test.js @@ -89,7 +89,7 @@ describe('Car', function(){ }); describe('#dropOff', function(){ - xit('should remove passenger from the passengers array', function(){ + it('should remove passenger from the passengers array', function(){ myCar.start(); myCar.pickUp("john"); myCar.dropOff("john"); diff --git a/src/car.js b/src/car.js index 250d678..6f5a157 100644 --- a/src/car.js +++ b/src/car.js @@ -27,12 +27,17 @@ Car.prototype.off = function(turnOff){ this.state = "off"; } -Car.prototype.pickUp = function(carPool) { +Car.prototype.pickUp = function(carPool){ if (this.state === "on") { this.passengers = ["john"]; } else if (this.state === "off") { this.passengers = []; }; + +Car.prototype.dropOff = function(byeJohn){ + this.passengers.pop("john"); +} + } From ed25cb13af0d833dfdcd607ac9885535bbeb6b57 Mon Sep 17 00:00:00 2001 From: Daisy Molving Date: Fri, 1 May 2015 11:33:51 +1200 Subject: [PATCH 14/14] stuck on the last question --- spec/test.js | 2 +- src/car.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/test.js b/spec/test.js index baa71dd..eba5b48 100644 --- a/spec/test.js +++ b/spec/test.js @@ -96,7 +96,7 @@ describe('Car', function(){ expect(myCar.passengers).to.be.empty; }); - xit('should leave passenger in the passengers array if car is off', function(){ + it('should leave passenger in the passengers array if car is off', function(){ myCar.start(); myCar.pickUp("john"); myCar.off(); diff --git a/src/car.js b/src/car.js index 6f5a157..1372549 100644 --- a/src/car.js +++ b/src/car.js @@ -36,6 +36,12 @@ Car.prototype.pickUp = function(carPool){ Car.prototype.dropOff = function(byeJohn){ this.passengers.pop("john"); + if (this.state === "off") { + + } + + + } }