Skip to content

Commit

Permalink
add jshint option to run on specs, fix some minor problems with specs
Browse files Browse the repository at this point in the history
  • Loading branch information
semmypurewal committed Mar 15, 2013
1 parent 4ffea5f commit 5973b39
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Expand Up @@ -19,7 +19,7 @@ module.exports = function (grunt) {
options: {
browser: true
},
all: ["Gruntfile.js", "src/**/*.js"]
all: ["Gruntfile.js", "src/**/*.js", "spec/**/*.js"]
},

concat: {
Expand Down
7 changes: 0 additions & 7 deletions spec/core/model.js
Expand Up @@ -626,24 +626,19 @@ describe("Model", function () {
Ferret = new Model();

Human = new Model(function () {
//console.log("at 1");
this.hasA("ferret").which.isA(Ferret);
this.hasA("name").which.isA("string");
this.isBuiltWith("name");
});

//console.log("at 2");
var Person = new Model(function () {
console.log("at 3");
this.hasA("ferret").which.validatesWith(function (ferret) {
console.log("at 4");
return ferret instanceof Ferret;
});
this.hasA("name").which.isA("string");
this.isBuiltWith("name");
});

//console.log("at 5");
Ferret = new Model(function () {
this.hasA("owner").which.isA(Human);
this.hasA("name").which.isA("string");
Expand All @@ -659,8 +654,6 @@ describe("Model", function () {
}).not.toThrow();
human.ferret(ferret);
ferret.owner(human);
//console.log(human.ferret().name());
//console.log(ferret.owner().name());
});
});

Expand Down
23 changes: 7 additions & 16 deletions spec/util/event_emitter.js
Expand Up @@ -10,17 +10,11 @@ describe("event emitter", function () {
beforeEach(function () {
e = new EventEmitter();

listener1 = function () {
console.log("hello from listener1!");
};
listener1 = function () { };

listener2 = function () {
console.log("hello from listener2!");
};
listener2 = function () { };

listener3 = function () {
console.log("hello from listener3!");
};
listener3 = function () { };
});

describe("constructor", function () {
Expand All @@ -34,12 +28,8 @@ describe("event emitter", function () {
});

it("should register multiple callbacks for a single event", function () {
e.on("event", function () {
console.log("function 1");
});
e.on("event", function () {
console.log("function 2");
});
e.on("event", function () { });
e.on("event", function () { });
expect(e.listeners("event").length).toBe(2);
});

Expand All @@ -62,7 +52,8 @@ describe("event emitter", function () {
});

it("should register multiple callbacks for a single event in a chain", function () {
e.on("event", function () { console.log("function 1");}).on("event", function () { console.log("function 2");});
e.on("event", function () { })
.on("event", function () { });
expect(e.listeners("event").length).toBe(2);
});

Expand Down

0 comments on commit 5973b39

Please sign in to comment.