Permalink
Browse files

add jshint option to run on specs, fix some minor problems with specs

  • Loading branch information...
1 parent 4ffea5f commit 5973b39f1a1a2059abf37a0ac36c03a330a95910 @semmypurewal committed Mar 15, 2013
Showing with 8 additions and 24 deletions.
  1. +1 −1 Gruntfile.js
  2. +0 −7 spec/core/model.js
  3. +7 −16 spec/util/event_emitter.js
View
@@ -19,7 +19,7 @@ module.exports = function (grunt) {
options: {
browser: true
},
- all: ["Gruntfile.js", "src/**/*.js"]
+ all: ["Gruntfile.js", "src/**/*.js", "spec/**/*.js"]
},
concat: {
View
@@ -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");
@@ -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());
});
});
View
@@ -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 () {
@@ -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);
});
@@ -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);
});

0 comments on commit 5973b39

Please sign in to comment.