Created
November 14, 2013 19:10
-
-
Save Madhuka/7472558 to your computer and use it in GitHub Desktop.
jasmine testing one (Car sample)
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
function Car(config) { | |
this.name = config.name; | |
this.engineSize = config.engineSize; | |
} | |
Car.prototype.getEngineSize = function() { | |
return this.engineSize; | |
}; |
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
describe("Car ", function() { | |
var myCar = new Car({ | |
name : "Vitz", | |
engineSize : 1000 | |
}); | |
it("Car will have name and engineSize", function() { | |
expect(myCar.name).toBe('Vitz'); | |
expect(myCar.engineSize).toBe(1000); | |
}); | |
it("Car will give it engineSize", function() { | |
expect(myCar.getEngineSize()).toBe(1000); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment