UT: Get WS ledger_current test working.

This commit is contained in:
Arthur Britto
2012-09-25 19:37:15 -07:00
parent 2e5189f276
commit 5a49b696ad

View File

@@ -12,7 +12,6 @@ var serverDelay = 1500;
buster.testRunner.timeout = 5000;
buster.testCase("Standalone server startup", {
"server start and stop": function(done) {
server.start("alpha",
@@ -56,44 +55,52 @@ buster.testCase("WebSocket connection", {
buster.assert(3 == stat); // CLOSED
done();
});
}, undefined, serverDelay);
}, serverDelay);
},
});
// var alpha = remote.remoteConfig("alpha");
//
// buster.testCase("Websocket commands", {
// 'setUp' :
// function(done) {
// server.start("alpha",
// function(e) {
// buster.refute(e);
//
// alpha.connect(function(stat) {
// buster.assert(1 == stat); // OPEN
//
// done();
// });
// });
// },
//
// 'tearDown' :
// function(done) {
// alpha.disconnect(function(stat) {
// buster.assert(3 == stat); // CLOSED
//
// server.stop("alpha", function(e) {
// buster.refute(e);
//
// done();
// });
// });
// },
//
// "assert" :
// function() {
// buster.assert(true);
// }
// });
// XXX Figure out a way to stuff this into the test case.
var alpha;
buster.testCase("Websocket commands", {
'setUp' :
function(done) {
server.start("alpha",
function(e) {
buster.refute(e);
alpha = remote.remoteConfig(config, "alpha");
alpha.connect(function(stat) {
buster.assert(1 == stat); // OPEN
done();
}, serverDelay);
});
},
'tearDown' :
function(done) {
alpha.disconnect(function(stat) {
buster.assert(3 == stat); // CLOSED
server.stop("alpha", function(e) {
buster.refute(e);
done();
});
});
},
"ledger_current" :
function(done) {
alpha.ledger_current(function (r) {
console.log(r);
buster.assert(r.ledger === 2);
done();
});
}
});
// vim:ts=4