Skip to content

Commit

Permalink
first version of Lock test
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrik committed Jun 14, 2012
1 parent 20595cb commit 4adb203
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/LockTest.js
@@ -0,0 +1,27 @@
(function() {
var assert = require("assert"),
Lock = require("../lib/Lock"),
LockQueueManager = require("../lib/LockQueueManager");

suite("Lock", function() {
suite("new Lock()", function() {
test("new Lock() should create lock with given name", function(done) {
var lock = new Lock("pew", new LockQueueManager());

assert.equal("pew", lock.getName());

done();
});

test("new Lock() should only accept LockQueueManager as manager argument", function(done) {
try {
new Lock("pew", {});
} catch (error) {
return done();
}

done(new Error("Invalid manager accepted"));
});
});
});
})();

0 comments on commit 4adb203

Please sign in to comment.