Repository URL to install this package:
|
Version:
0.0.6-dev ▾
|
var expect = chai.expect;
describe("Cow", function() {
describe("constructor", function() {
it("should have a default name", function() {
var cow = new Cow();
expect(cow.name).to.equal("Anon cow");
});
it("should set cow's name if provided", function() {
var cow = new Cow("Carla");
expect(cow.name).to.equal("Carla");
});
});
describe("#greets", function() {
it("should throw if no target is passed in", function() {
expect(function() {
(new Cow()).greets();
}).to.throw(Error);
});
it("should greet passed target", function() {
var greetings = (new Cow("Carla")).greets("Table");
expect(greetings).to.equal("Carla greets Table");
});
});
});