Skip to content

Commit

Permalink
added some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Jun 27, 2011
1 parent 546b9f2 commit f8be475
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions test/tests.js
Expand Up @@ -135,6 +135,18 @@ exports["functions + servers"] = {

test.expect(1);
test.equal(gearman.servers.foo.functions.length, 1, "One item in server functions array");
test.done();
},

"add function without server throws": function(test){
var gearman = new Gearnode();

gearman.addFunction("bar", function(){});

test.throws(function(){
gearman.submitJob("test","test");
});

test.done();
}
};
Expand Down Expand Up @@ -289,7 +301,7 @@ module.exports["worker behavior"] = testCase({
if(data[buf.length-i-1] != buf[i]){
ok = false;
break;
};
}
}
test.ok(ok, "Received reversed binary");
test.done();
Expand Down Expand Up @@ -505,7 +517,7 @@ module.exports["worker behavior"] = testCase({
var job = this.client.submitJob("testjob_disconnect","test");

job.on("complete", function(data){
test.ok(false, "Should not complete")
test.ok(false, "Should not complete");
test.done();
});

Expand Down Expand Up @@ -536,7 +548,7 @@ module.exports["worker behavior"] = testCase({
});

job.on("complete", function(data){
test.ok(false, "Should not complete")
test.ok(false, "Should not complete");
test.done();
});

Expand Down

0 comments on commit f8be475

Please sign in to comment.